mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
test: use long timeout for event waits in interface_ipc_mining #36862
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!36862
Loading…
Reference in a new issue
No description provided.
Delete branch "ipc-mining-long-timeout"
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?
Follow-up to #36791, https://github.com/bitcoin/bitcoin/pull/36791#discussion_r4565761925 by ryanofsky.
#36791 fixed the
waitTipChangedtimeout on slow hosts, but thetemplate6waitNextcall has the same race: it waits for an event the test triggers after a 0.1s sleep, with a 1s timeout.This adds
long_ipc_timeoutand uses it for all waits that end on an event the test triggers.To reproduce failure on master:
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.Concept ACK
🟠 Minor · The template2 timeout can expire before its scaled pre-generation sleep
Source inspection shows that large timeout factors, including documented
--timeout-factor 0, can make thetemplate2wait expire before its scheduled block generation, causing the functional test's non-null assertion to fail.Location:
test/functional/interface_ipc_mining.py:278(head).Review coverage was incomplete.
Reviewed:
74135e2e6250· Review report · Previous reportspermalink
Tested ACK
74135e2e62. This finishes the fix from #36791: every wait that returns on an event the test triggers now has at least a minute, so none of them can time out on a slow host with the default timeout factor. I checked that the test passes normally, with the faketime command from #36791, and withsleep_time=1.2on thetemplate6wait, which failed before.The waits still using
default_ipc_timeout(template4,template5and the twowaitNextpolicy tests) are fine as they are: the fees they wait for are already in the mempool, andwaitNextalways checks fees once after its first one-second tick, however short the timeout.tACK
74135e2e62ACK
74135e2e62this uncovers a pre-existing bug for large timeout factor values
(recall the sleep time here is seconds, not ms)
This is a pre-existing bug, but the changes in this pull will now cause the tests to deterministically fail with a high timeout factor, because the
long_ipc_timeout(~1s*factor) would happen before the generate after1.1s *factor.As a regression test against
feeThreshold = MAX_MONEY, the sleep only needs to ensure that the one-second fee-check tick elapses. Scaling it makes the test unnecessarily slow, adding roughly timeout_factor seconds of idle time to every run.The correct sleep to use here is 1.1s, or maybe 2s, if you want to allow for more machines to hit the tick, but if a machine is slower than that to call a simple IPC call, it doesn't seem worth it to accommodate in the test (and slow down all of our CI runs).
Fixed in https://github.com/bitcoin/bitcoin/pull/36924
Also, I am a bit confused about the 60s floor of long_ipc_timeout. Why is it needed?
default_ipc_timeoutis already scaled by the timeout factor to accommodate slow machines, so it seems confusing to have a different variable to track the same thing? I'd saylong_ipc_timeoutshould be removed.nit: Just like below (
no_event_timeout_ms), it would be good to include the type here. Everything in the python tests is usually denoted in float seconds, so it would be good to mark the places that are not.Quoting from https://github.com/bitcoin/bitcoin/pull/36791#discussion_r4565751670:
The reasoning is that this could fail in slow machines (laptop) that run with default timeout factor, though idk if this was seen on real hardware before.
Ah thx for the reference. The general idea is that the tests should pass on any idk mid-range machine (even laptop) sold in the last few years with the default timeout-factor.
default_ipc_timeoutis too small to accommodate that, it should just be increased maybe from 1s to 2s. (Such a change should be harmless, because in the happy path it should still pass as fast as your machine is)So I haven't tried it, but I think in your command:
you can increase the --timeout-factor, because a 10x relative speed doesn't seem like normal hardware.
I think there is one more place which can spell out the fee tick wait explicitly:
Everything else can use the
default_ipc_timeout_msandlong_ipc_timeoutcan be removed.