Repository navigation
ci-flake: raise the backend unit shard wall budget to 900s on the 2026-10-26 measured distribution - #23692
Conversation
…6-10-26 measured distribution
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.
4 issues found across 4 files
Confidence score: 4/5
- In
.github/workflows/backend-unit-tests.yml, the ceiling rationale assumes a 10-minute apt step, but the timeout is 7 minutes; that makes the stated slack and 570-second allowance inaccurate. Recompute them using the 7-minute cap (1,482 seconds total, leaving 318 seconds). - In
scripts/ci/test_nightly_main_workflow.py, the comments still describe a 15-minute ceiling and 180 seconds of leftover time, though the current values are 30 minutes and 900 seconds. Update both comments. - In
.github/workflows/backend-unit-tests.ymland.github/ci-budget.yaml, the current-state rationale still says the step budget is 720 seconds, while the gate is now 900 seconds. Update those references so maintainers use the right budget. - In
.github/workflows/backend-unit-tests.yml, the breach summary counts eight observations and gives a 757.75-second average, but the data has nine observations averaging 754.3 seconds. Recompute the sample summary.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/ci/test_nightly_main_workflow.py">
<violation number="1" location="scripts/ci/test_nightly_main_workflow.py:35">
P3: This comment is now wrong: with a 30m ceiling and a 900s step budget, the leftover is 900s, not 180s. The '15-min job ceiling' line directly above is also stale and should say 30-min.</violation>
</file>
<file name=".github/workflows/backend-unit-tests.yml">
<violation number="1" location=".github/workflows/backend-unit-tests.yml:175">
P2: The ceiling math cites a 10m apt cap, but the apt step is `timeout-minutes: 7`. Update to 7m and recompute: 72+90+420+900 = 1482s, leaving 318s of the 30m job. The 570s allowance line needs the same correction.</violation>
<violation number="2" location=".github/workflows/backend-unit-tests.yml:321">
P3: The listed breach values contain nine observations, not eight, and average 754.3s rather than 757.75s. Recompute the sample summary so the threshold rationale matches the measurements.</violation>
<violation number="3" location=".github/workflows/backend-unit-tests.yml:326">
P3: `BACKEND_UNIT_STEP_BUDGET_SECONDS` now sets the gate to 900s, but the workflow overview and `.github/ci-budget.yaml` still say it is unchanged at 720s. Update those current-state rationales so maintainers do not rely on the obsolete budget.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| timeout-minutes: 25 | ||
| # 39741901310, 39739120103, 39676205452, 39668020536). 30m holds the | ||
| # 900s step budget (2026-10-26 recalibration, see the env comment) plus | ||
| # worst-plausible setup with the apt step capped at 10m (72s worst |
There was a problem hiding this comment.
P2: The ceiling math cites a 10m apt cap, but the apt step is timeout-minutes: 7. Update to 7m and recompute: 72+90+420+900 = 1482s, leaving 318s of the 30m job. The 570s allowance line needs the same correction.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/backend-unit-tests.yml, line 175:
<comment>The ceiling math cites a 10m apt cap, but the apt step is `timeout-minutes: 7`. Update to 7m and recompute: 72+90+420+900 = 1482s, leaving 318s of the 30m job. The 570s allowance line needs the same correction.</comment>
<file context>
@@ -163,20 +163,21 @@ jobs:
- timeout-minutes: 25
+ # 39741901310, 39739120103, 39676205452, 39668020536). 30m holds the
+ # 900s step budget (2026-10-26 recalibration, see the env comment) plus
+ # worst-plausible setup with the apt step capped at 10m (72s worst
+ # checkout + ~90s toolchain + ~570s apt cold allowance) and teardown —
+ # 72+90+570+900 = 1632s, leaving 168s inside the line; slow TEST steps
</file context>
| ("mobile-app-checks.yml", "ios-compile-check", "timeout-minutes"): "50", | ||
| # Backend unit shard: the 15-min job ceiling includes runner setup, but | ||
| # the 720s step regression budget excludes it, leaving 180s for setup. | ||
| # the step regression budget excludes it, leaving 180s for setup. |
There was a problem hiding this comment.
P3: This comment is now wrong: with a 30m ceiling and a 900s step budget, the leftover is 900s, not 180s. The '15-min job ceiling' line directly above is also stale and should say 30-min.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At scripts/ci/test_nightly_main_workflow.py, line 35:
<comment>This comment is now wrong: with a 30m ceiling and a 900s step budget, the leftover is 900s, not 180s. The '15-min job ceiling' line directly above is also stale and should say 30-min.</comment>
<file context>
@@ -32,7 +32,7 @@ def jobs(text):
("mobile-app-checks.yml", "ios-compile-check", "timeout-minutes"): "50",
# Backend unit shard: the 15-min job ceiling includes runner setup, but
- # the 720s step regression budget excludes it, leaving 180s for setup.
+ # the step regression budget excludes it, leaving 180s for setup.
# Setup measured 73-92s typical, 227s worst (run 39741901310 attempt 2:
# checkout 72s, apt-get 155s), so 227s + 720s crossed the ceiling and the
</file context>
| # 40278890153 s3 — whose re-run passed at 719s on identical code | ||
| # and selection). Green main shard walls run 583-701s, so the line | ||
| # sits inside the wall distribution's right tail. 900s is above | ||
| # mean+3sigma of the eight observed breaches (757.75 +/- 41.6) and |
There was a problem hiding this comment.
P3: The listed breach values contain nine observations, not eight, and average 754.3s rather than 757.75s. Recompute the sample summary so the threshold rationale matches the measurements.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/backend-unit-tests.yml, line 321:
<comment>The listed breach values contain nine observations, not eight, and average 754.3s rather than 757.75s. Recompute the sample summary so the threshold rationale matches the measurements.</comment>
<file context>
@@ -306,12 +307,23 @@ jobs:
+ # 40278890153 s3 — whose re-run passed at 719s on identical code
+ # and selection). Green main shard walls run 583-701s, so the line
+ # sits inside the wall distribution's right tail. 900s is above
+ # mean+3sigma of the eight observed breaches (757.75 +/- 41.6) and
+ # holds the 841s worst with 59s headroom without assuming which
+ # files grew. No single file regressed — the per-file session cost
</file context>
| # files grew. No single file regressed — the per-file session cost | ||
| # is unchanged and the drift tracks selection growth. Raise only | ||
| # again with measured evidence or rebalance the shards. | ||
| BACKEND_UNIT_STEP_BUDGET_SECONDS: "900" |
There was a problem hiding this comment.
P3: BACKEND_UNIT_STEP_BUDGET_SECONDS now sets the gate to 900s, but the workflow overview and .github/ci-budget.yaml still say it is unchanged at 720s. Update those current-state rationales so maintainers do not rely on the obsolete budget.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/backend-unit-tests.yml, line 326:
<comment>`BACKEND_UNIT_STEP_BUDGET_SECONDS` now sets the gate to 900s, but the workflow overview and `.github/ci-budget.yaml` still say it is unchanged at 720s. Update those current-state rationales so maintainers do not rely on the obsolete budget.</comment>
<file context>
@@ -306,12 +307,23 @@ jobs:
+ # files grew. No single file regressed — the per-file session cost
+ # is unchanged and the drift tracks selection growth. Raise only
+ # again with measured evidence or rebalance the shards.
+ BACKEND_UNIT_STEP_BUDGET_SECONDS: "900"
run: |
step_started=$SECONDS
</file context>
…-glm-5-3/2b7400fb5642 # Conflicts: # .github/workflows/backend-unit-tests.yml # backend/AGENTS.md # backend/tests/unit/test_workflow_contracts.py # scripts/ci/test_nightly_main_workflow.py
The origin/main update merge carried a stale clang-format layout for this out-of-scope firmware file into the branch. Restore it byte-identical to origin/main; the PR itself only touches the backend unit shard budget.
…6-10-26 measured distribution (BasedHardware#23692) * ci-flake: raise the backend unit shard wall budget to 900s on the 2026-10-26 measured distribution * Restore omi/firmware/omi/src/safe_mode.c to the origin/main layout The origin/main update merge carried a stale clang-format layout for this out-of-scope firmware file into the branch. Restore it byte-identical to origin/main; the PR itself only touches the backend unit shard budget.
Flake
Backend unit shard 3/6failed withFAIL: backend unit shard 3 took 808s, over its 720s regression budgeton run 40278890153 (job 121427530649, PR #23676, lane/n7-logging-tail). Every test inside the step passed; the only failure is the wall-clock gate.Evidence it is a flake, not a real regression
The same job re-run on identical code and identical selection (2319 files, 387 in shard 3) passed at 719s — one second under the line. Wall variance of ~90s (12%) on unchanged work is runner noise, not a code change.
Independent budget breaches, all on full-suite selections (~2313–2319 files → ~385–387 files per shard), all with every test passing:
Eight breaches across six different shards, five different PRs plus main, over four days of unrelated code. Green main shard walls the same day ran 583–701s (runs 40279956475, 40279196312, 40276152427, 40274881847) — the 720s line now sits inside the wall distribution's right tail.
Root cause is suite growth, not a slower file: the selection grew from 1727 files when the six-shard rebalance (#21259, 2026-10-11) sized ~288 files per shard under the 720s gate (itself set 2026-10-03 as worst-observed 602s + 19.6% headroom) to 2319 today (+34%, ~387 per shard), and the slowest shard's wall drifted past the line almost linearly with it. The suite's cost is per-file pytest process startup (measured 2026-09-10, run 34430370667: 19m18s of a 21m53s run); no single file regressed. Phase split of the dispatched 808s: ~10s preflight + ~108s pyright + ~689s per-file test sessions — the growth is in the test-session count.
Change
BACKEND_UNIT_STEP_BUDGET_SECONDS720 → 900 for the shard step, with the measured distribution recorded in the env comment. 900 is above mean+3σ of the eight observed breaches (757.75 ± 41.6 → 882) and holds the 841s worst observed wall with 59s headroom. Green runs pay nothing: the gate only ends over-budget runs later.backend/tests/unit/test_workflow_contracts.py(budget literal) andscripts/ci/test_nightly_main_workflow.py(ceiling literal + rationale), plus the budget mention inbackend/AGENTS.md.Complementary work already in flight: #23682 defers the heavy Anthropic/Gemini SDK imports out of per-file test startup (~⅓ of files), which pulls the whole distribution down once merged; this recalibration is the measured bridge that stops the false failures until then and after any future growth.
The
.github/workflows/backend-unit-tests.ymledit touches only this flake's own step and job ceiling; no new workflows, no skipped, xfailed, or deleted tests, no--no-verify. Budget-raise-with-measured-evidence is the remedy David named for CI flake fixes (standing ask of 2026-10-22). Widening the shard matrix instead would trip the CI runner-minute budget ratchet (.github/ci-budget.yaml) and is better taken deliberately if the drift recurs.This supersedes #23322, #23347, and #23473 — the same change cut from earlier dispatches of this flake (their evidence tables stop at the 2026-10-24 753s worst; today's distribution reaches 841s and adds the dispatched 808s example plus the 719s re-run proof). Merge one and close the other three.
Verification
nice -n 19:pytest tests/unit/test_workflow_contracts.py— 96 passed.pytest tests/unit/test_backend_unit_ci_runner.py— 13 passed.python3 scripts/ci/test_nightly_main_workflow.py— 5 tests OK (edited pin file).python3 .github/scripts/check_ci_budget.py— passed (inventory unaffected: matrix, triggers, runner,if,needsunchanged).actionlint .github/workflows/backend-unit-tests.yml— clean.scripts/pr-preflight --suggest— no product-invariant citations required; nofix:commit, no failure-class declaration required.