test: move SyncWithValidationInterfaceQueue() before Stop() in txindex_tests
So that the call order is the same as in coinstatsindex_tests.
This commit is contained in:
1 file changed
+8
-3
@@ -69,11 +69,16 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// It is not safe to stop and destroy the index until it finishes handling
|
||||||
|
// the last BlockConnected notification. The BlockUntilSyncedToCurrentChain()
|
||||||
|
// call above is sufficient to ensure this, but the
|
||||||
|
// SyncWithValidationInterfaceQueue() call below is also needed to ensure
|
||||||
|
// TSAN always sees the test thread waiting for the notification thread, and
|
||||||
|
// avoid potential false positive reports.
|
||||||
|
SyncWithValidationInterfaceQueue();
|
||||||
|
|
||||||
// shutdown sequence (c.f. Shutdown() in init.cpp)
|
// shutdown sequence (c.f. Shutdown() in init.cpp)
|
||||||
txindex.Stop();
|
txindex.Stop();
|
||||||
|
|
||||||
// Let scheduler events finish running to avoid accessing any memory related to txindex after it is destructed
|
|
||||||
SyncWithValidationInterfaceQueue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
Reference in new issue
Block a user