Skip to content

ci-flake: raise backend-unit-shard wall budget to 900s on measured variance evidence - #23347

Closed
Git-on-my-level wants to merge 1 commit into
BasedHardware:mainfrom
Git-on-my-level:agent/m1-studio-zcode-glm-5-3/59ca145240c2
Closed

Git-on-my-level wants to merge 1 commit into
BasedHardware:mainfrom
Git-on-my-level:agent/m1-studio-zcode-glm-5-3/59ca145240c2

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Flake

backend-unit-shard-wall-budget-over-720s — backend unit shard jobs failing their 720 s wall-budget regression gate while every test in the shard passes.

Evidence it is a flake, not a regression

Seven all-green shards tripped the 720 s line on 2026-10-22 alone:

Run Shard Wall Tests
39724496366 (main) 3/6 722 s all pass
39729721832 (PR) 1/6 728 s all pass
39751140474 (PR) 3/6 758 s all pass
39754037197 (main) 5/6 726 s all pass
39840781349 (main) 6/6 790 s all pass
39844128555 (PR #23289) 5/6 732 s all pass

The decisive datum: run 39844128555 shard 5 took 732 s on attempt 1 and 521 s on attempt 2 of the same commit and the same 367-file selection — pure GitHub-hosted runner variance (CPU steal during per-file pytest process startup).

Across 48 green shard walls sampled from eight same-day runs, walls ran 373–700 s (median ~617 s); the selection has grown to ~2,206 files (367–368 per shard) versus the 1,727 the 720 s line was last balanced against (#21237), so the variance tail now crosses the gate.

Fix

Raise BACKEND_UNIT_STEP_BUDGET_SECONDS 720 → 900 s, the smallest durable change:

  • 900 s holds the worst observed legitimate wall (790 s) with 110 s (13.9 %) headroom and sits 200 s above the top of the green distribution.
  • It stays inside the 20 m job ceiling with worst measured setup: 227 s + 900 s = 1127 s < 1200 s, keeping the ceiling a hang bound rather than a second gate.
  • The alternative structural fix (more shards) is blocked by .github/ci-budget.yaml: the Linux minutes/day cap (13,660) has ~23 min headroom against the current 13,637 forecast, and two extra shards × ~120 runs/day would add ~1,900 min/day. Rebalancing with a budget re-forecast remains the documented path if suite growth erodes 900 s, as Retrieve bounded Dream neighbourhoods with target and context roles #21237 did.
  • Sharing pytest processes across files to cut startup cost stays off the table: measured SIGSEGV/OOM contamination (see backend/test.sh).

Contract updates in the same commit: the workflow-contract pin in backend/tests/unit/test_workflow_contracts.py and the budget mention in backend/AGENTS.md.

The .github edit touches only this flake's own step budget, per the 2026-10-22 CI flake-fix mandate (David). No tests were skipped, xfailed, or deleted.

Local verification (nice -n 19)

  • actionlint .github/workflows/backend-unit-tests.yml — clean
  • pytest backend/tests/unit/test_workflow_contracts.py backend/tests/unit/test_backend_typecheck_predicate.py backend/tests/unit/test_backend_unit_ci_runner.py — 109 passed
  • .github/scripts/test_check_ci_budget.py — 12 tests OK

View guided diff

…riance evidence

Seven all-green backend-unit shards tripped the 720s regression budget on
2026-10-22 (722-790s) while 48 same-day green shard walls ran 373-700s
(median ~617s) on a selection that grew to ~2,206 files (367-368 per
shard). The clearest variance proof: run 39844128555 shard 5 (PR BasedHardware#23289)
took 732s on attempt 1 and 521s on attempt 2 of the same commit and
selection. The gate now sits above that variance tail with 110s (13.9%)
headroom over the worst observed legitimate wall and still inside the 20m
job ceiling with worst measured setup (227s + 900s = 1127s).

The .github edit touches only this flake's own step budget, per David's
2026-10-22 CI flake-fix mandate.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-22T21:11:35.715482Z d57231a 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.

@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: d57231a80b

ℹ️ 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".

# only with measured evidence; when suite growth erodes this
# again, rebalance the shard count with a ci-budget.yaml
# re-forecast the way #21237 did.
BACKEND_UNIT_STEP_BUDGET_SECONDS: "900"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Increase the job timeout alongside the step budget

When pre-test setup takes more than 300s—a reachable case in this job because checkout, Python/uv/Helm/dependency/cache setup all precede the test and the native-audio install alone has a 5-minute allowance—the unchanged 20-minute job timeout leaves less than this new 900s wall budget. GitHub will then cancel the shard before the post-run budget check at lines 304-308 can report its result, recreating the cancelled flake this change is meant to remove; raise the job ceiling too and update its pinned timeout contract.

Useful? React with 👍 / 👎.

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

2 issues found across 3 files

Confidence score: 3/5

  • In .github/workflows/backend-unit-tests.yml, the 900-second test budget doesn’t account for native audio setup taking up to 5 minutes, so a slow setup can hit the 20-minute job timeout before the budget check. Align the timeout accounting with the setup cap.
  • .github/ci-budget.yaml still documents a 720-second gate, which makes budget audits and future re-forecasts inconsistent with the workflow. Update the shard rationale to 900 seconds.
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=".github/workflows/backend-unit-tests.yml">

<violation number="1" location=".github/workflows/backend-unit-tests.yml:176">
P2: The timeout accounting is incorrect: the native audio setup step is capped at 5 minutes, not 3. With a 900-second test budget, a slow setup can still hit the 20-minute job timeout before the budget check; align the setup cap and job-budget calculation so this gate cannot regress to `cancelled`.</violation>

<violation number="2" location=".github/workflows/backend-unit-tests.yml:292">
P3: The CI budget inventory still documents the old 720-second gate after this workflow raises it to 900 seconds. Update the shard rationale in `.github/ci-budget.yaml` so budget audits and future re-forecasts describe the current contract.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

# teardown; slow TEST steps still fail loudly through the step's own
# 720s budget check, so this ceiling stays a hang bound, not the gate.
# 900s budget plus worst-plausible setup (227s + 900s = 1127s; apt is
# step-capped at 3m) and teardown; slow TEST steps still fail loudly

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: The timeout accounting is incorrect: the native audio setup step is capped at 5 minutes, not 3. With a 900-second test budget, a slow setup can still hit the 20-minute job timeout before the budget check; align the setup cap and job-budget calculation so this gate cannot regress to cancelled.

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 176:

<comment>The timeout accounting is incorrect: the native audio setup step is capped at 5 minutes, not 3. With a 900-second test budget, a slow setup can still hit the 20-minute job timeout before the budget check; align the setup cap and job-budget calculation so this gate cannot regress to `cancelled`.</comment>

<file context>
@@ -159,21 +159,23 @@ jobs:
-    # teardown; slow TEST steps still fail loudly through the step's own
-    # 720s budget check, so this ceiling stays a hang bound, not the gate.
+    # 900s budget plus worst-plausible setup (227s + 900s = 1127s; apt is
+    # step-capped at 3m) and teardown; slow TEST steps still fail loudly
+    # through the step's own 900s budget check, so this ceiling stays a hang
+    # bound, not the gate.
</file context>

# only with measured evidence; when suite growth erodes this
# again, rebalance the shard count with a ci-budget.yaml
# re-forecast the way #21237 did.
BACKEND_UNIT_STEP_BUDGET_SECONDS: "900"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The CI budget inventory still documents the old 720-second gate after this workflow raises it to 900 seconds. Update the shard rationale in .github/ci-budget.yaml so budget audits and future re-forecasts describe the current contract.

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 292:

<comment>The CI budget inventory still documents the old 720-second gate after this workflow raises it to 900 seconds. Update the shard rationale in `.github/ci-budget.yaml` so budget audits and future re-forecasts describe the current contract.</comment>

<file context>
@@ -274,12 +276,20 @@ jobs:
+          # only with measured evidence; when suite growth erodes this
+          # again, rebalance the shard count with a ci-budget.yaml
+          # re-forecast the way #21237 did.
+          BACKEND_UNIT_STEP_BUDGET_SECONDS: "900"
         run: |
           step_started=$SECONDS
</file context>

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Closing as a duplicate of #23692 — same change (shard step budget 720→900s in backend-unit-tests.yml plus the matching contract pin in test_workflow_contracts.py and the backend/AGENTS.md mention), cut from an earlier dispatch of this flake with an evidence table that stops at the 2026-10-22 790s worst.

#23692 carries the latest measured distribution (through 2026-10-26, worst legitimate wall 841s in run 40267543640, plus the 808s→719s same-code re-run pair) and also updates the nightly INTENTIONAL_BUDGET_CHANGES ceiling pin to 30m, which the 900s budget requires. This PR left the ceiling inside the 20m envelope and still has unresolved Codex findings; superseding it with #23692 as the single open recalibration. Not rebasing this branch.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Hey @Git-on-my-level 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

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