test: Fix race condition in IPC interface block progation test #33880

pull fjahr wants to merge 1 commits into bitcoin:master from fjahr:2025-11-ipc-test changing 1 files +3 −1
  1. fjahr commented at 10:08 pm on November 15, 2025: contributor

    CI failed on this condition here: https://github.com/bitcoin/bitcoin/actions/runs/19395398994/job/55494696022?pr=33878#step:9:3983

    The check was added not too long ago in #33745 and the fix here switches the check to the node which actually produces the block. There are also some comments added to make the checks easier so understand.

    Closes #33884

  2. DrahtBot added the label Tests on Nov 15, 2025
  3. DrahtBot commented at 10:08 pm on November 15, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33880.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK Sjors, maflcko

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. fjahr commented at 10:08 pm on November 15, 2025: contributor
    cc: @Sjors
  5. fjahr force-pushed on Nov 15, 2025
  6. DrahtBot added the label CI failed on Nov 15, 2025
  7. DrahtBot commented at 10:32 pm on November 15, 2025: contributor

    🚧 At least one of the CI tasks failed. Task lint: https://github.com/bitcoin/bitcoin/actions/runs/19396238061/job/55496659251 LLM reason (✨ experimental): Lint failure: ruff reports undefined name wait_until in test/functional/interface_ipc.py.

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  8. DrahtBot removed the label CI failed on Nov 15, 2025
  9. in test/functional/interface_ipc.py:259 in a3cd119e26 outdated
    255@@ -256,7 +256,7 @@ async def interrupt_wait():
    256             assert_equal(res.result, True)
    257 
    258             self.log.debug("Block should propagate")
    259-            assert_equal(self.nodes[1].getchaintips()[0]["height"], current_block_height + 1)
    


    Sjors commented at 9:07 am on November 17, 2025:
    Maybe just move this line below sync_all.
  10. Sjors commented at 9:14 am on November 17, 2025: member

    Good catch. The test needs to check two things:

    1. The IPC node actually updates it own chain after submitBlock()
    2. The other node accepts the block

    So the check for current_block_height + 1 is important, but we should either do it for self.nodes[0] (no need to wait_until) or keep it for self.nodes[1], but after sync_all.

    Only relying on sync_all is not enough, because it won’t catch a regression where the IPC code fails to update the node itself, so there’s no block to propagate and the nodes remained synced.

  11. maflcko added this to the milestone 31.0 on Nov 17, 2025
  12. fanquake requested review from ryanofsky on Nov 17, 2025
  13. fjahr force-pushed on Nov 19, 2025
  14. fjahr commented at 6:25 pm on November 19, 2025: contributor

    Good catch. The test needs to check two things:

    Thanks for explaining, I have switched the check to node0 and kept it above the sync because that feels like the most natural flow given my improved understanding of the test now. I have also added some short comments based on your explanation.

  15. Sjors commented at 7:20 pm on November 19, 2025: member
    utACK 944502628a532469b0d3c9a3af04fa2d9c18f849
  16. test: Fix race condition in IPC interface block propagation test 2578e6fc0f
  17. in test/functional/interface_ipc.py:260 in 944502628a
    255@@ -256,9 +256,11 @@ async def interrupt_wait():
    256             assert_equal(res.result, True)
    257 
    258             self.log.debug("Block should propagate")
    259-            assert_equal(self.nodes[1].getchaintips()[0]["height"], current_block_height + 1)
    260+            # Check that the IPC node actually updates it own chain
    261+            assert_equal(self.nodes[0].getchaintips()[0]["height"], current_block_height + 1)
    


    maflcko commented at 7:36 pm on November 19, 2025:
    it own -> its own [possessive pronoun "its" required; "it" is incorrect here]
    

    drahtbot_id_5_m


    fjahr commented at 10:20 pm on November 19, 2025:
    Fixed
  18. fjahr force-pushed on Nov 19, 2025
  19. Sjors commented at 7:22 am on November 20, 2025: member
    re-utACK 2578e6fc0f4af35f389cd8ff59825c874e0b72ac
  20. maflcko commented at 7:32 am on November 20, 2025: member
    lgtm ACK 2578e6fc0f4af35f389cd8ff59825c874e0b72ac
  21. fanquake merged this on Nov 20, 2025
  22. fanquake closed this on Nov 20, 2025


fjahr DrahtBot Sjors maflcko


ryanofsky

Labels
Tests

Milestone
31.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-11-27 00:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me