mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-04 19:43:29 +02:00
test: silence TSAN false positive in coinstatsindex_initial_sync
Fixes https://github.com/bitcoin/bitcoin/issues/25365
This commit is contained in:
@@ -76,10 +76,16 @@ BOOST_FIXTURE_TEST_CASE(coinstatsindex_initial_sync, TestChain100Setup)
|
|||||||
|
|
||||||
BOOST_CHECK(block_index != new_block_index);
|
BOOST_CHECK(block_index != new_block_index);
|
||||||
|
|
||||||
|
// 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)
|
||||||
coin_stats_index.Stop();
|
coin_stats_index.Stop();
|
||||||
|
|
||||||
// Rest of shutdown sequence and destructors happen in ~TestingSetup()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test shutdown between BlockConnected and ChainStateFlushed notifications,
|
// Test shutdown between BlockConnected and ChainStateFlushed notifications,
|
||||||
|
Reference in New Issue
Block a user