Merge bitcoin/bitcoin#34528: test: Fix intermittent failure in feature_assumevalid.py by ensuring invalid block was processed before checking debug.log

b73a62f667d0220a5700a02e11736684d2214b04 test: Ensure invalid block was processed before checking debug.log (Ava Chow)

Pull request description:

  Prior to merging a PR, I run 4 different build configurations and their tests in parallel, and consistently one of those will have `feature_assumevalid.py` fail. The failure is because the `assert_debug_log` context exits before the invalid block is processed, so the lines it is looking for don't appear in the part of the log that it is examining.

  This PR should resolve that issue by waiting for `getchaintips` to report that the invalid chain is invalid before exiting the `assert_debug_log` context.

ACKs for top commit:
  l0rinc:
    tested ACK b73a62f667d0220a5700a02e11736684d2214b04
  sedited:
    ACK b73a62f667d0220a5700a02e11736684d2214b04

Tree-SHA512: 96409ed55f686961c47949d31569d6be8e424d952883c92a9135a4e8a795047d4e2a86c9d27ef5653d21780717275434b0bca1586059cfd5088cd2c867c7baea
This commit is contained in:
merge-script 2026-02-07 15:08:08 +01:00
commit b2805eec35
No known key found for this signature in database
GPG Key ID: 9B79B45691DB4173

View File

@ -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]