Skip to content

Commit 6526dc3

Browse files
committed
test: silence TSAN false positive in coinstatsindex_initial_sync
Fixes bitcoin#25365
1 parent 2e77dff commit 6526dc3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/test/coinstatsindex_tests.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,16 @@ BOOST_FIXTURE_TEST_CASE(coinstatsindex_initial_sync, TestChain100Setup)
7676

7777
BOOST_CHECK(block_index != new_block_index);
7878

79+
// It is not safe to stop and destroy the index until it finishes handling
80+
// the last BlockConnected notification. The BlockUntilSyncedToCurrentChain()
81+
// call above is sufficient to ensure this, but the
82+
// SyncWithValidationInterfaceQueue() call below is also needed to ensure
83+
// TSAN always sees the test thread waiting for the notification thread, and
84+
// avoid potential false positive reports.
85+
SyncWithValidationInterfaceQueue();
86+
7987
// Shutdown sequence (c.f. Shutdown() in init.cpp)
8088
coin_stats_index.Stop();
81-
82-
// Rest of shutdown sequence and destructors happen in ~TestingSetup()
8389
}
8490

8591
// Test shutdown between BlockConnected and ChainStateFlushed notifications,

0 commit comments

Comments
 (0)