Skip to content

Commit f9d50e8

Browse files
author
MarcoFalke
committed
Merge #15410: test: txindex: interrupt threadGroup before calling destructor
fab6b07 test: txindex: interrupt threadGroup before calling destructor (MarcoFalke) Pull request description: Fixes the data races with the tread sanitizer such as * https://travis-ci.org/MarcoFalke/bitcoin/jobs/492330554 * bitcoin/bitcoin#15402 (comment) * ... Tree-SHA512: 40608c70d92a1dd68efc1d41eecc8e2fb7738508e21f91f0ad353adcceed60fa624f15bf72a5b69a9444157b261183abbe9fc4cc5dd8aebc1c49506b239e8e88
2 parents 743c2f4 + fab6b07 commit f9d50e8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/test/txindex_tests.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
6969
}
7070
}
7171

72-
txindex.Stop(); // Stop thread before calling destructor
72+
// shutdown sequence (c.f. Shutdown() in init.cpp)
73+
txindex.Stop();
74+
75+
threadGroup.interrupt_all();
76+
threadGroup.join_all();
77+
78+
// Rest of shutdown sequence and destructors happen in ~TestingSetup()
7379
}
7480

7581
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)