AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

Merge bitcoin/bitcoin#36529: test: measure rpcwaittimeout floor with monotonic time

Public commit record

What the developer wrote

Authored by merge-script

91/100 · Strong
Merge bitcoin/bitcoin#36529: test: measure rpcwaittimeout floor with monotonic time

dc27539d42bbfc04705d9ae1ea00cf70b046d8fa test: measure rpcwaittimeout floor with monotonic time (nervana21)

Pull request description:

Previously, `interface_bitcoin_cli.py` measured the `-rpcwaittimeout` wait floor with `time.time()`. `bitcoin-cli` arms that deadline with `std::chrono::steady_clock`, so a CI wall-clock step backward can make the elapsed time look short and cause the assert to fail.

Fix this by using `time.monotonic()` instead and using `-rpcwaittimeout=1`. The log line also now says "at least" so it matches the floor assert.

h/t ViniciusCestarii for suggesting `time.monotonic()` here.

ACKs for top commit:
maflcko:
lgtm ACK dc27539d42bbfc04705d9ae1ea00cf70b046d8fa
ViniciusCestarii:
ACK dc27539d42bbfc04705d9ae1ea00cf70b046d8fa

Tree-SHA512: 1213f786d21ce2fa0eb8f08a7c3c381a65dbfec3c4b534516b545e90ca661b0cda84de1482fb41cfe0e53b2a4dabc587f42701e8686b27455591859290c3a855
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a flaky automated test in Bitcoin Core. The test checks that bitcoin-cli waits at least the requested timeout before giving up when it cannot connect to the server. Previously the test used wall-clock time (time.time()), which can jump backwards if the computer's clock is adjusted, causing the test to fail even though nothing was wrong. The fix switches to monotonic time (time.monotonic()), which only moves forward, and shortens the timeout from 5 seconds to 1 second. There is no change to the actual Bitcoin Core software that users run, only to the test suite.

Recommended action

No security action required. This is a test-only reliability improvement. Reviewers can merge as-is.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.