Repository navigation
test(soak): add opt-in timeout to Benchmark.run() on 2.4 (fix S7 TypeError) - #499
Merged
Merged
Conversation
…Error)
The Monitor/Soak nightly's 2.4 leg failed every run on
`soak/test_slow_network.py`:
TypeError: Benchmark.run() got an unexpected keyword argument 'timeout'
Root cause: the soak backport (#467 via #493) brought test_slow_network's
`benchmark.run(timeout=test_time + 90)` call to 2.4, but 2.4's
tests/mb.py `Benchmark.run()` never had a `timeout` parameter (that was a
separate master-only change). master's S7 leg passes; 2.4's raised at call
time.
Backport the timeout support, but default to None (not master's 240s):
2.4 has many existing `run()` callers with no explicit timeout and its
long soak/staircase runs can legitimately exceed 240s, so a 240s default
could newly kill them. None preserves the prior wait-to-completion
behaviour for those callers while giving the explicit-timeout caller
(test_slow_network) fail-fast on a hang.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1d2e1f6. Configure here.
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Adversarial review of #499 flagged the test_slow_network comment still claiming run() defaults to 240s (carried over from master via #467) -- false on 2.4 where this PR defaults run() to None. Doc-only; the call already passes an explicit timeout. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…th (Bugbot #499) On TimeoutExpired, capture e.stderr (output buffered before the timeout) and prepend it to the post-kill drain, which is often empty -- otherwise mb.stderr could be lost despite the timeout path promising a truncated log. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Failure
The nightly Soak / Stress 2.4 leg fails every run on
soak/test_slow_network.py(S7):(master's S7 leg passes.)
Root cause
A backport gap:
soak/test_slow_network.py(brought to 2.4 via #467 in #493) callsbenchmark.run(timeout=test_time + 90), but 2.4'stests/mb.pyBenchmark.run()never had atimeoutparameter — master added it separately. So the call raisesTypeErrorat runtime on 2.4 only.Fix
Backport
Benchmark.run()'s timeout support to 2.4, defaulting toNonerather than master's240:run()callers with no explicit timeout, and long soak/staircase runs can legitimately exceed 240s — a 240s default could newly kill them and create fresh failures.None= wait indefinitely = exactly the prior 2.4 behaviour for those callers (zero regression); the explicit-timeout caller (test_slow_network) gets fail-fast on a hang.Verified:
Benchmark.run(timeout=...)no longer raises; signaturerun(self, timeout=None).🤖 Generated with Claude Code
Note
Low Risk
Test harness change only; default
timeout=Nonepreserves existing callers; timeout behavior is opt-in except for the already-broken S7 call site.Overview
Fixes the 2.4 soak S7 failure where
soak/test_slow_network.pycallsbenchmark.run(timeout=test_time + 90)butBenchmark.run()did not accepttimeout, causing aTypeError.tests/mb.py:Benchmark.run()now takes an optionaltimeout(seconds). When set,communicate(timeout=...)is used; on expiry the child is killed, stderr is preserved and written,mb.timeoutis recorded, and the method returnsFalseinstead of hanging until CI kills the job. Default remainsNone(wait forever), unlike master’s 240s default, so existing callers that usebenchmark.run()with no args keep prior 2.4 behavior for long soak runs.tests/soak/test_slow_network.py: Comments only—document the opt-in timeout and thetest_time + 90bound for fail-fast on hangs.Reviewed by Cursor Bugbot for commit 679a880. Bugbot is set up for automated code reviews on this repo. Configure here.