Skip to content

test(stt): bound the brownout replay at its asserted limit - #20255

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/live-gate-replay-timing
Oct 2, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/live-gate-replay-timing

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

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, then 1.14s > 1.00s on a rerun), which fails "Backend unit shard 4/4" for unrelated PRs (seen on #20250). The assertion is median(samples) <= limit; a run that has not detected by limit cannot bring the median under it, so capping the horizon at limit proves 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

Review in cubic

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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T03:41:37.951357Z 1b51ec1 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 8cdeea9 into main Oct 2, 2026
59 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/live-gate-replay-timing branch October 2, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant