Repository navigation
test(stt): bound the brownout replay at its asserted limit - #20255
Conversation
The case ran every seed to 5,000 sessions and exceeded the CI per-test timing guard (1.17s > 1.00s), failing unit shard 4 on unrelated PRs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b51ec1386
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| samples = [detect(rate, seed)[0] for seed in range(30)] | ||
| # A run that has not detected by the limit cannot lower the median below it, | ||
| # so stopping there proves the same bound without running undetected seeds on. | ||
| samples = [detect(rate, seed, horizon=limit)[0] for seed in range(30)] |
There was a problem hiding this comment.
Do not censor the upper middle detection time
When exactly 15 of the 30 seeded runs detect by limit, replacing every later detection with limit + 1 can turn a real regression into a pass because statistics.median averages the 15th and 16th observations. For example, if those observations are limit - 1 and limit + 100, the original test fails with a median above the limit, while this capped version substitutes limit + 1 and reports a passing median equal to the limit. Retain the uncensored middle observation or use an odd sample count/count-based assertion whose result is determined at the cutoff.
Useful? React with 👍 / 👎.
What
tests/unit/test_live_gate_replay.py::test_brownout_median_detection[0.12-1500]now stops each simulated run at the limit it asserts against, instead of always running to 5,000 sessions.Why
The test exceeds the backend unit timing guard on CI runners (
1.17s > 1.00s, then1.14s > 1.00son a rerun), which fails "Backend unit shard 4/4" for unrelated PRs (seen on #20250). The assertion ismedian(samples) <= limit; a run that has not detected bylimitcannot bring the median under it, so capping the horizon atlimitproves the same bound. No production code changes.Local: the two brownout cases take 0.18s and 0.09s; the file passes (722 tests).
Product invariants affected
None — test-only change.
Failure-Class: none
🤖 Generated with Claude Code