mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-09 20:59:38 +02:00
Merge bitcoin/bitcoin#27348: test: fix intermittent failure in ChainStateManager tests
f8abcb3e3b2e731c002ec88f7559c21e26a2c079 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:
crACK f8abcb3e3b
MarcoFalke:
lgtm ACK f8abcb3e3b2e731c002ec88f7559c21e26a2c079
Tree-SHA512: 953fcca46ffee039ae1c8c98eed5464ba7ee0007f54e18989caab3f645f5f45e64407a21f614984fd2843a3d56219f44603086b0c305a9a5cec64a8bf76c110a
This commit is contained in:
commit
86e7410b22
@ -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…
x
Reference in New Issue
Block a user