Skip to content

Commit

Permalink
Merge bitcoin#15410: test: txindex: interrupt threadGroup before call…
Browse files Browse the repository at this point in the history
…ing 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#15402 (comment)
  * ...

Tree-SHA512: 40608c70d92a1dd68efc1d41eecc8e2fb7738508e21f91f0ad353adcceed60fa624f15bf72a5b69a9444157b261183abbe9fc4cc5dd8aebc1c49506b239e8e88
  • Loading branch information
MarcoFalke authored and PastaPastaPasta committed Jul 1, 2021
1 parent 0474e4e commit c9eba77
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/test/txindex_tests.cpp
Expand Up @@ -62,7 +62,13 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
}
}

txindex.Stop(); // Stop thread before calling destructor
// shutdown sequence (c.f. Shutdown() in init.cpp)
txindex.Stop();

threadGroup.interrupt_all();
threadGroup.join_all();

// Rest of shutdown sequence and destructors happen in ~TestingSetup()
}

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit c9eba77

Please sign in to comment.