Merge bitcoin/bitcoin#36848: test: drop flaky "server too slow" check from interface_http.py
What changed, and why it matters
This commit only changes a test file to make a timing check less strict. It removes an upper-bound timing assertion that was causing false test failures on slow CI machines. There is no change to Bitcoin Core's actual network or wallet code, so it does not introduce or fix a security issue in the software users run.
No security action needed. This is a test-only reliability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies test/functional/interface_http.py. It drops the assertion that the HTTP server disconnects within seconds+2, keeping only the lower-bound check (duration >= seconds-1). The PR description explains this was a flaky test for -rpcservertimeout behavior; coverage of exact disconnect timing was already added to the unit tests in #36159. No production code is changed.
Changed components
test/functional/interface_http.pyInspect captured patch +6 / −6
### test/functional/interface_http.py
@@ -93,14 +93,14 @@ def expect_timeout(self, seconds):
# Wait for response, but expect a timeout disconnection
start = time.monotonic()
response1 = self.recv_raw()
- stop = time.monotonic()
+ duration = time.monotonic() - start
# Server disconnected with EOF
assert_equal(response1, b"")
- # Server disconnected within an acceptable range of time:
- # not immediately, and not too far over the configured duration.
- # This allows for some jitter in the test between client and server.
- duration = stop - start
- assert duration <= seconds + 2, f"Server disconnected too slow: {duration} > {seconds}"
+ # Server did not disconnect before the configured idle duration
+ # (allowing 1s of jitter between client and server). There is no
+ # upper bound: slow CI machines can overshoot arbitrarily, and the
+ # socket timeout (rpc_timeout) already catches a server that never
+ # disconnects. Exact timing is covered by httpserver_tests.
assert duration >= seconds - 1, f"Server disconnected too fast: {duration} < {seconds}"
# The connection is definitely closed.
assert self.sock_closed()Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.