mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
Merge bitcoin/bitcoin#27348: test: fix intermittent failure in ChainStateManager tests
f8abcb3e3b
test: Fix intermittent failure in ChainStateManager tests (Martin Zumsande) Pull request description: Before wiping a `ChainStateManager` and creating a new one, the `validationinterface` queue should be emptied to avoid the possibility of accessing deleted memory. This could lead to very rare CI failures reported in #26613 and #27320 (see [here](https://github.com/bitcoin/bitcoin/issues/27320#issuecomment-1485694691) for a more detailed explanation). Fixes #27320 ACKs for top commit: jamesob: crACKf8abcb3e3b
MarcoFalke: lgtm ACKf8abcb3e3b
Tree-SHA512: 953fcca46ffee039ae1c8c98eed5464ba7ee0007f54e18989caab3f645f5f45e64407a21f614984fd2843a3d56219f44603086b0c305a9a5cec64a8bf76c110a
This commit is contained in:
commit
86e7410b22
1 changed files with 4 additions and 1 deletions
|
@ -367,10 +367,13 @@ struct SnapshotTestSetup : TestChain100Setup {
|
|||
|
||||
BOOST_TEST_MESSAGE("Simulating node restart");
|
||||
{
|
||||
LOCK(::cs_main);
|
||||
for (Chainstate* cs : chainman.GetAll()) {
|
||||
LOCK(::cs_main);
|
||||
cs->ForceFlushStateToDisk();
|
||||
}
|
||||
// Process all callbacks referring to the old manager before wiping it.
|
||||
SyncWithValidationInterfaceQueue();
|
||||
LOCK(::cs_main);
|
||||
chainman.ResetChainstates();
|
||||
BOOST_CHECK_EQUAL(chainman.GetAll().size(), 0);
|
||||
const ChainstateManager::Options chainman_opts{
|
||||
|
|
Loading…
Add table
Reference in a new issue