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.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Oct 20 2020, 23:51
cmake/modules/TestSuite.cmake
194 ↗(On Diff #24871)

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 ↗(On Diff #24871)

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.