Page MenuHomePhabricator

test: Set catch_system_errors=no on boost unit tests
ClosedPublic

Authored by jasonbcox on Oct 20 2020, 23:46.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC1a60077296f7: test: Set catch_system_errors=no on boost unit tests
Summary

Boost does not handle asserts well in unit tests. Encountering one causes
test_bitcoin to hang indefinitely. This may explain the occassional timeouts we're
experiencing in CI.

See https://www.boost.org/doc/libs/1_68_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/catch_system.html

Backport of Core PR18183

Test Plan

Introduce assert(0); into a unit test, then: ninja check
Pre-patch, ninja check hangs until killed (Ctrl+C).
Post-patch, ninja check errors out as expected.

Event Timeline

This revision is now accepted and ready to land.Oct 20 2020, 23:51
cmake/modules/TestSuite.cmake
194

If this is static and never changes, you should push it down the stack instead of adding it to every callsites.

cmake/modules/TestSuite.cmake
194

I agree. I looked into this and it wasn't immediately obvious how to do it without refactoring a lot of code. I will chat with Fabien about it.