test: Speed up interface_ipc_mining.py and fix large timeout-factor bug #36924

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2611-fix-ipc-mining-test-issues changing 1 files +9 −8
  1. maflcko commented at 9:25 AM on November 20, 2026: member

    The test would fail with a large enough timeout factor, because the ipc times out before the delayed generate() call: template2 would be None and fail the assert.

    Also, the test would sleep more than timeout_factor seconds in the happy case in all test runs.

    Fix both issues by sleeping for a bit longer than a single fee tick.

  2. test: Rename default_ipc_timeout -> default_ipc_timeout_ms
    Functional-test time values are commonly seconds-based, so rename this to clarify it is ms.
    fae567777f
  3. test: Speed up interface_ipc_mining.py and fix large timeout-factor bug
    The test would fail with a large enough timeout factor, because the ipc
    times out before the delayed generate() call: template2 would be None
    and fail the assert.
    
    Also, the test would sleep more than timeout_factor seconds in the happy
    case in all test runs.
    
    Fix both issues by sleeping for a bit longer than a single fee tick.
    Also, use default_ipc_timeout_ms, because a longer timeout is not
    needed.
    faa89b1ae6
  4. DrahtBot renamed this:
    test: Speed up interface_ipc_mining.py and fix large timeout-factor bug
    test: Speed up interface_ipc_mining.py and fix large timeout-factor bug
    on Nov 20, 2026
  5. DrahtBot added the label Tests on Nov 20, 2026
  6. DrahtBot commented at 9:25 AM on November 20, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK ViniciusCestarii, nervana21, mercie-ux

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  7. maflcko added this to the milestone 33.0 on Nov 20, 2026
  8. maflcko commented at 9:41 AM on November 20, 2026: member

    It should be possible to test this locally via: --timeout-factor=61. On master, the test deterministically fails, on this pull, it passes.

    Or with --timeout-factor=40: On master, the test sleeps that long before passing, on this pull, it passes twice as fast.

    The failure looks something like:

     test  2026-11-18T06:23:07.740448Z TestFramework (ERROR): Unexpected exception: 
                                       Traceback (most recent call last):
                                         File "/ci_container_base/test/functional/test_framework/test_framework.py", line 146, in main
                                           self.run_test()
                                         File "/ci_container_base/ci/scratch_ ₿🧪_/build-x86_64-pc-linux-gnu/test/functional/interface_ipc_mining.py", line 893, in run_test
                                           self.run_block_template_test()
                                         File "/ci_container_base/ci/scratch_ ₿🧪_/build-x86_64-pc-linux-gnu/test/functional/interface_ipc_mining.py", line 343, in run_block_template_test
                                           asyncio.run(capnp.run(async_routine()))
                                         File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
                                           return runner.run(main)
                                                  ^^^^^^^^^^^^^^^^
                                         File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
                                           return self._loop.run_until_complete(task)
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                         File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
                                           return future.result()
                                                  ^^^^^^^^^^^^^^^
                                         File "capnp/lib/capnp.pyx", line 2085, in run
                                         File "capnp/lib/capnp.pyx", line 2086, in capnp.lib.capnp.run
                                         File "/ci_container_base/ci/scratch_ ₿🧪_/build-x86_64-pc-linux-gnu/test/functional/interface_ipc_mining.py", line 287, in async_routine
                                           assert template2 is not None
                                                  ^^^^^^^^^^^^^^^^^^^^^
                                       AssertionError
    
  9. DrahtBot added the label CI failed on Nov 20, 2026
  10. fanquake commented at 11:09 AM on November 20, 2026: member
  11. fanquake requested review from Sjors on Nov 20, 2026
  12. fanquake closed this on Nov 20, 2026

  13. fanquake reopened this on Nov 20, 2026

  14. DrahtBot removed the label CI failed on Nov 20, 2026
  15. ViniciusCestarii commented at 3:16 PM on November 20, 2026: contributor

    tACK faa89b1ae68d8548f6288521b06c064fcfc0b50f

    Confirmed this fix the slowdown and the error when timeout factor is 55+.

  16. nervana21 commented at 2:48 PM on November 21, 2026: contributor

    tACK faa89b1ae68d8548f6288521b06c064fcfc0b50f

  17. mercie-ux commented at 5:31 PM on November 21, 2026: contributor

    Tested ACK faa89b1

    verified the 2s sleep covers a fee tick. with feeThreshold = 1 the test fails because block2 has more than one transaction.

  18. fanquake merged this on Nov 21, 2026
  19. fanquake closed this on Nov 21, 2026

  20. maflcko deleted the branch on Nov 22, 2026


Sjors

Labels

Milestone
33.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: 2026-12-01 02:51 UTC

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