test: remove some avoidable test waits #36446

Manually merged
willcl-ark merged 4 commits from speedup-tests into master 2026-10-15 01:05:54 +00:00 AGit
willcl-ark commented 2026-10-06 08:27:34 +00:00 (Migrated from github.com)

A few of our longer-running tests have some unnecessary waits and timeouts in them. Reduce or replace them to shorten test times:

  • in p2p_node_network_limited replace the expected sync timeout with header/ping barriers and a bounded negative check. At CI timeout factor 40, saves roughly 195 seconds per transport.
  • in interface_ipc_mining cap three expected no-event waits at five seconds, saving roughly 105 seconds at factor 40 in CI.
  • in WalletLoadingDescriptors honor sanity mode’s single epoch, avoiding four unnecessary wallet unload/load cycles.
  • two wallet unit tests switch to BasicTestingSetup avoiding construction of two unused 100-block chains.

The timeout changes alone save approximately eight minutes of accumulated test-worker time on CI jobs running both transports and IPC mining. Wall-clock savings depend on parallel scheduling, CPU etc.

A few of our longer-running tests have some unnecessary waits and timeouts in them. Reduce or replace them to shorten test times: - in `p2p_node_network_limited` replace the expected sync timeout with header/ping barriers and a bounded negative check. At CI timeout factor 40, saves roughly 195 seconds per transport. - in `interface_ipc_mining` cap three expected no-event waits at five seconds, saving roughly 105 seconds at factor 40 in CI. - in `WalletLoadingDescriptors` honor sanity mode’s single epoch, avoiding four unnecessary wallet unload/load cycles. - two wallet unit tests switch to `BasicTestingSetup` avoiding construction of two unused 100-block chains. The timeout changes alone save approximately eight minutes of accumulated test-worker time on CI jobs running both transports and IPC mining. Wall-clock savings depend on parallel scheduling, CPU etc.
DrahtBot commented 2026-10-06 08:27:41 +00:00 (Migrated from github.com)

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

External sites

Reviews

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

Type Reviewers
ACK Ayoazeez26, maflcko, ViniciusCestarii

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #35598 (test: cover feeThreshold = MAX_MONEY in interface_ipc_mining.py by Sjors)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36446 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36446.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36446#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [Ayoazeez26](https://github.com/bitcoin/bitcoin/pull/36446#issuecomment-6048133040), [maflcko](https://github.com/bitcoin/bitcoin/pull/36446#pullrequestreview-5514036238), [ViniciusCestarii](https://github.com/bitcoin/bitcoin/pull/36446#pullrequestreview-5526190992) | 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. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#35598](https://github.com/bitcoin/bitcoin/pull/35598) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35598.svg"></sub> (test: cover feeThreshold = MAX_MONEY in interface_ipc_mining.py by Sjors) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
willcl-ark commented 2026-10-06 08:27:51 +00:00 (Migrated from github.com)
I run these on free GHA runners here: https://github.com/willcl-ark/bitcoin/actions/runs/37357329900
First-time contributor

Base: acaf322fc438e6bd180b23189a5661c8f02d88fb
Head: ce1d88b2632cc3950f47d8b191bdd74b806eb3ae

Design and approach

Bound readiness waits (test/functional/p2p_node_network_limited.py:147, head)

Both readiness barriers use wait_until’s default 60-second timeout, scaled by timeout_factor. At factor 40, either can stall for up to 40 minutes before the bounded negative check runs. The replaced sync_blocks wait was bounded at 5 seconds before scaling, or 200 seconds at factor 40. Give the readiness phase an explicit, shared timeout budget suited to these local-node exchanges while allowing for slow CI.

Review coverage was incomplete. The archaeology review had incomplete evidence. The alternatives experiment had incomplete evidence.

Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> Base: `acaf322fc438e6bd180b23189a5661c8f02d88fb` Head: `ce1d88b2632cc3950f47d8b191bdd74b806eb3ae` ##### Design and approach **Bound readiness waits** (test/functional/p2p_node_network_limited.py:147, head) Both readiness barriers use `wait_until`’s default 60-second timeout, scaled by `timeout_factor`. At factor 40, either can stall for up to 40 minutes before the bounded negative check runs. The replaced `sync_blocks` wait was bounded at 5 seconds before scaling, or 200 seconds at factor 40. Give the readiness phase an explicit, shared timeout budget suited to these local-node exchanges while allowing for slow CI. Review coverage was incomplete. The archaeology review had incomplete evidence. The alternatives experiment had incomplete evidence. [Full review report](<https://review.fish.foo/traces/36446-ce1d88b2632cc3950f47d8b191bdd74b806eb3ae-460-1.html>)
Ayoazeez26 commented 2026-10-07 22:26:53 +00:00 (Migrated from github.com)

tACK ce1d88b263

Built on macOS (arm64) and compared against master:

p2p_node_network_limited.py: 15 s → 8–9 s (v1 and v2 transport)
interface_ipc_mining.py --timeout-factor=10: 50 s → 34 s
wallet_disableprivkeys + dummy_input_size_test: pass, small speedup (user CPU 0.15 s → 0.11 s)
WalletLoadingDescriptors: normal results unchanged (~335 ms/op), as expected; -sanity-check runs fine
All wallet_tests pass

tACK ce1d88b263 Built on macOS (arm64) and compared against master: `p2p_node_network_limited.py`: 15 s → 8–9 s (v1 and v2 transport) `interface_ipc_mining.py --timeout-factor=10`: 50 s → 34 s `wallet_disableprivkeys + dummy_input_size_test`: pass, small speedup (user CPU 0.15 s → 0.11 s) `WalletLoadingDescriptors`: normal results unchanged (~335 ms/op), as expected; `-sanity-check` runs fine All `wallet_tests` pass
fanquake commented 2026-10-14 06:19:50 +00:00 (Migrated from github.com)

cc @ViniciusCestarii

cc @ViniciusCestarii
maflcko (Migrated from github.com) approved these changes 2026-10-14 06:49:50 +00:00
maflcko (Migrated from github.com) left a comment

review ACK ce1d88b263 🐠

Show signature

Signature:

untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: review ACK ce1d88b2632cc3950f47d8b191bdd74b806eb3ae 🐠
ljalevF1PRZiYJ9dTCCTkGiL/FY1wHlrxkYPn5ihrbJlBfMDv3OfjWF5tzjiTTnqm8hbnpM+rtLr/WAnh3a7BQ==
review ACK ce1d88b2632cc3950f47d8b191bdd74b806eb3ae 🐠 <details><summary>Show signature</summary> Signature: ``` untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}" RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM= trusted comment: review ACK ce1d88b2632cc3950f47d8b191bdd74b806eb3ae 🐠 ljalevF1PRZiYJ9dTCCTkGiL/FY1wHlrxkYPn5ihrbJlBfMDv3OfjWF5tzjiTTnqm8hbnpM+rtLr/WAnh3a7BQ== ``` </details>
maflcko (Migrated from github.com) commented 2026-10-14 06:45:21 +00:00

nit in 06cb869112: Is the ensure_for needed? There is no "trickle delay" for blocks, so just a plain assert_equal like before should be enough?

nit in 06cb869112da6bb1c43f938b2e5a9794f825ff92: Is the ensure_for needed? There is no "trickle delay" for blocks, so just a plain `assert_equal` like before should be enough?
ViniciusCestarii (Migrated from github.com) reviewed 2026-10-14 23:47:48 +00:00
ViniciusCestarii (Migrated from github.com) left a comment

ACK ce1d88b263

Checked the speed ups on CI and it looks pretty good! "test: avoid unused wallet test chains" ce1d88b263 doens't seem to speed up much, but it is a fine change.

ACK ce1d88b2632cc3950f47d8b191bdd74b806eb3ae Checked the speed ups on CI and it looks pretty good! "test: avoid unused wallet test chains" ce1d88b2632cc3950f47d8b191bdd74b806eb3ae doens't seem to speed up much, but it is a fine change.
maflcko (Migrated from github.com) reviewed 2026-10-15 10:16:27 +00:00
maflcko (Migrated from github.com) commented 2026-10-15 10:16:27 +00:00
There are also other issues and typos in the test, so I fixed it in https://github.com/bitcoin/bitcoin/pull/36541
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36446
No description provided.