Skip to content

Commit 13d2a33

Browse files
committed
Fix unregister_all_during_call cleanup
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 <[email protected]> bitcoin/bitcoin#18551 (comment)
1 parent 1f70185 commit 13d2a33

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/test/validationinterface_tests.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <boost/test/unit_test.hpp>
6-
76
#include <consensus/validation.h>
87
#include <primitives/block.h>
98
#include <scheduler.h>
9+
#include <test/util/setup_common.h>
1010
#include <util/check.h>
1111
#include <validationinterface.h>
1212

13-
BOOST_AUTO_TEST_SUITE(validationinterface_tests)
13+
BOOST_FIXTURE_TEST_SUITE(validationinterface_tests, TestingSetup)
1414

1515
class TestInterface : public CValidationInterface
1616
{
@@ -43,9 +43,6 @@ class TestInterface : public CValidationInterface
4343
BOOST_AUTO_TEST_CASE(unregister_all_during_call)
4444
{
4545
bool destroyed = false;
46-
47-
CScheduler scheduler;
48-
GetMainSignals().RegisterBackgroundSignalScheduler(scheduler);
4946
RegisterSharedValidationInterface(std::make_shared<TestInterface>(
5047
[&] {
5148
// First call should decrements reference count 2 -> 1

0 commit comments

Comments
 (0)