diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-04-08 23:24:41 +0800 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-04-08 23:24:54 +0800 |
commit | 2392566284d84ad905d03617b07a906386f8769c (patch) | |
tree | 25a48f9ba5fdb05801f7c4e6f00552108486b9f7 | |
parent | b3c3d9a518f8cc51c0b73c5e4ee6bd567be441d2 (diff) | |
parent | 13d2a33537a403ac47a989be92109d3214375b6a (diff) | |
download | bitcoin-2392566284d84ad905d03617b07a906386f8769c.tar.xz |
Merge #18563: test: Fix unregister_all_during_call cleanup
13d2a33537a403ac47a989be92109d3214375b6a Fix unregister_all_during_call cleanup (Russell Yanofsky)
Pull request description:
Use `TestingSetup` fixture to fix `unregister_all_during_call` test not calling `UnregisterBackgroundSignalScheduler`, which could trigger an assert in `RegisterBackgroundSignalScheduler` when called in later tests
Failure reported by fanquake https://github.com/bitcoin/bitcoin/pull/18551#issuecomment-610974251
ACKs for top commit:
MarcoFalke:
ACK 13d2a33537a403ac47a989be92109d3214375b6a if appveyor unit tests pass
Tree-SHA512: d2ec8ff14c54d97903af50031abfac1f38ec1c3aabc90371cfd5b79481fa69d3d77f339bfdf7d2178fd85e83402f72eda7cf4d339e5bbfa7e6e1a68836643b93
-rw-r--r-- | src/test/validationinterface_tests.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/test/validationinterface_tests.cpp b/src/test/validationinterface_tests.cpp index b4aa2f0f3a..208be92852 100644 --- a/src/test/validationinterface_tests.cpp +++ b/src/test/validationinterface_tests.cpp @@ -3,14 +3,14 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <boost/test/unit_test.hpp> - #include <consensus/validation.h> #include <primitives/block.h> #include <scheduler.h> +#include <test/util/setup_common.h> #include <util/check.h> #include <validationinterface.h> -BOOST_AUTO_TEST_SUITE(validationinterface_tests) +BOOST_FIXTURE_TEST_SUITE(validationinterface_tests, TestingSetup) class TestInterface : public CValidationInterface { @@ -43,9 +43,6 @@ public: BOOST_AUTO_TEST_CASE(unregister_all_during_call) { bool destroyed = false; - - CScheduler scheduler; - GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); RegisterSharedValidationInterface(std::make_shared<TestInterface>( [&] { // First call should decrements reference count 2 -> 1 |