Skip to content

test(soak): add opt-in timeout to Benchmark.run() on 2.4 (fix S7 TypeError) - #499

Merged
fcostaoliveira merged 3 commits into
2.4from
fix/soak-mb-run-timeout-2.4
Jun 29, 2026
Merged

fcostaoliveira merged 3 commits into
2.4from
fix/soak-mb-run-timeout-2.4

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Jun 29, 2026 •

Copy link
Copy Markdown
Collaborator

Failure

The nightly Soak / Stress 2.4 leg fails every run on soak/test_slow_network.py (S7):

TypeError: Benchmark.run() got an unexpected keyword argument 'timeout'
Total Tests Run: 1, Total Tests Failed: 1

(master's S7 leg passes.)

Root cause

A backport gap: soak/test_slow_network.py (brought to 2.4 via #467 in #493) calls benchmark.run(timeout=test_time + 90), but 2.4's tests/mb.py Benchmark.run() never had a timeout parameter — master added it separately. So the call raises TypeError at runtime on 2.4 only.

Fix

Backport Benchmark.run()'s timeout support to 2.4, defaulting to None rather than master's 240:

  • 2.4 has many 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; signature run(self, timeout=None).

🤖 Generated with Claude Code


Note

Low Risk
Test harness change only; default timeout=None preserves 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.py calls benchmark.run(timeout=test_time + 90) but Benchmark.run() did not accept timeout, causing a TypeError.

tests/mb.py: Benchmark.run() now takes an optional timeout (seconds). When set, communicate(timeout=...) is used; on expiry the child is killed, stderr is preserved and written, mb.timeout is recorded, and the method returns False instead of hanging until CI kills the job. Default remains None (wait forever), unlike master’s 240s default, so existing callers that use benchmark.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 the test_time + 90 bound 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.

…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]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread tests/mb.py Resolved
@fcostaoliveira fcostaoliveira added the run-soak Triggers soak/stress nightly suite on this PR label Jun 29, 2026
@jit-ci

jit-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

fcostaoliveira and others added 2 commits June 29, 2026 05:07
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]>
@fcostaoliveira
fcostaoliveira merged commit 8fb5843 into 2.4 Jun 29, 2026
75 checks passed
@fcostaoliveira fcostaoliveira mentioned this pull request Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-soak Triggers soak/stress nightly suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant