mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 14:11:39 +00:00
test: poll more frequently in sync helpers and RPC connection wait #36439
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36439
Loading…
Reference in a new issue
No description provided.
Delete branch "speedup-test-framework"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tested on my x86-64 machine:
Also compared the CI on my fork (time for test_runner.py runtime):
Sanitizer jobs are left out because they vary too much between runs.
Alpine (musl) uses --usecli, so more frequent poll creates a new bitcoin-cli process each time, making it not faster with these changes. Also tried locally with --usecli: from 2060s to 2051s accumulated.
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.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Base:
89a3a13c44e85c6e32ac54444fdf5e07886842e8Head:
8898f832d9d86d5a6a8ad8719e1009c702bbf4bdI found no actionable issues in this static review.
Full review report
haven't tested this, but it seems fine. I wonder if someone wants to create some plots to show this is an improvement (and to see the performance plot around the values). Also, I think functional tests are run at double saturation (2*nproc) sometimes, so it would be good to check this doesn't regress either.
Pretty sure I tried this one in the past, but it didn't result in a speed-up. I guess back then the trickle relay was used, and dominated. Now, the immediate tx relay is used for most tests and it can help.
nit: Use a deadline time here as well?
Makes sense, Done in
88d40ec155Thanks @maflcko for reviewing. Force-pushed
88d40ec155addressing https://github.com/bitcoin/bitcoin/pull/36439#discussion_r4192615551By what I found, only the job "test ancestor commits" does it. Agree it's worth checking.
Will do.
Interesting, makes sense.
I benchmarked these changes on my x86-64 machine with 20 logic processors:
wait_for_rpc_connectionchange, sync0.05 is only the sync changes.Most of the gain comes from the sync change and RPC poll change adds a smaller one on top. Below 0.05 there is no further improvement and at -j40 polling faster (w0.01) starts to cost more than it saves, so 0.05 looks like the right value.
It'd be great if others could run it too.
I measured this with this script: https://gist.github.com/ViniciusCestarii/72216066d3707b41b3b5b2292b07055b usign the command:
I used AI to help me make this benchmark script and plot the data.
nit: force named kwargs while touching this line? Same below
kwargs are nice, done on
0b928e01dfNice. I asked an LLM bot to run a few benches on my Travel Laptop (155H cpu).
So I think the takeaway is that 0.05 is a valid choice.
I wonder if some sanitizer-heavy CIs (tsan, msan, asan) will also benefit from this, or is the variance too high to see something here?
nit from the Ralph LLM to use monotonic time.
Use a monotonic clock for the RPC startup deadline (test/functional/test_framework/test_node.py:365, head)
time.time() can jump during startup polling: a forward adjustment can make the loop fail before rpc_timeout elapses, while a backward adjustment can extend the wait. Use time.monotonic() for both deadline creation and comparison. No actual host-clock adjustment during startup was identified, so the impact is conditional on that trigger.
Lgtm. Just curious about the sanitizer CI, but not a blocker.
review ACK
0b928e01df📗Show signature
Signature:
Done in
8898f832d9. There are also other tests that use time.time() for measuring duration instead of monotonic that could also be changed, but I guess clock jumping is not common so it is a non issue today.The latest Ralph Review is hallucinated AI slop (https://review.fish.foo/traces/36439-8898f832d9d86d5a6a8ad8719e1009c702bbf4bd-804-4.html). cc @willcl-ark for awareness, but seems fine to just ignore.
Only change is addressing the prior Ralph Review nit.
review ACK
8898f832d9👪Show signature
Signature: