From b73a62f667d0220a5700a02e11736684d2214b04 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Fri, 6 Feb 2026 12:02:39 -0800 Subject: [PATCH] test: Ensure invalid block was processed before checking debug.log In feature_assumevalid.py, we check that a modified block 102 is invalid by asserting a message in the debug.log. However, this can intermittently fail as exiting the assert_debug_log can occur before the block has actually been validated, thus causing the test to fail as the validation error message is not present in the chunk of the debug.log being examined. We can wait for the block to make an invalid chain tip to ensure that the log line will be present. --- test/functional/feature_assumevalid.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/feature_assumevalid.py b/test/functional/feature_assumevalid.py index ed2bff63daa..2ee23c6eb7e 100755 --- a/test/functional/feature_assumevalid.py +++ b/test/functional/feature_assumevalid.py @@ -164,6 +164,7 @@ class AssumeValidTest(BitcoinTestFramework): self.send_blocks_until_disconnected(p2p0) self.wait_until(lambda: self.nodes[0].getblockcount() >= COINBASE_MATURITY + 1) assert_equal(self.nodes[0].getblockcount(), COINBASE_MATURITY + 1) + self.wait_until(lambda: next(filter(lambda x: x["hash"] == self.blocks[-1].hash_hex, self.nodes[0].getchaintips()))["status"] == "invalid") # nodes[1]