Skip to content

ci-flake: recalibrate backend unit shard budget to measured 900s - #23473

Closed
Git-on-my-level wants to merge 1 commit into
mainfrom
ci-flake/backend-unit-shard-budget-20261024
Closed

Git-on-my-level wants to merge 1 commit into
mainfrom
ci-flake/backend-unit-shard-budget-20261024

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Flake

Backend unit shard N/6 fails with FAIL: backend unit shard N took Xs, over its 720s regression budget on PRs and main pushes whose changes are unrelated to the wall time. Dispatched example: run 40065443584 shard 6 (735s, PR #23437).

Evidence it is a flake, not a real regression

Budget breaches on 2026-10-24 alone, all on full-suite selections (~2260–2277 files → ~377–380 files per shard):

Run Shard Wall Where
40042164324 4/6 727s main push
40061077340 4/6 727s main push
40065443584 6/6 735s PR #23437 (lane/syn003-gate3-signal)
40066103575 6/6 753s feat/account-wide-custom-instructions-20214
40066874798 1/6 725s lane/w1-projection-publication-1024

Near-misses the same day: 716s (40066103575 s3), 712s (40065224420 s6), 695s (40065762218 s6), 689s. Five breaches across five runs on four different shards and unrelated code; the failing shard differs run to run and every test inside the steps passed. Small selections stay far under budget (82–236s), so only full-suite selections are exposed.

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 to ~2270 today (+32%, ~378 per shard), and the slowest shard's wall drifted past the line almost linearly with it. The 720s value was set on 2026-10-03 (220c64b) as worst-observed-wall + 19.6% headroom over 602s; the same policy over today's 753s worst gives ~900s. The slowest single file (tests/unit/test_runtime_image_contracts.py, ~187s session) is present in every run including green ones and is not new — no per-file regression to fix.

Change

  • BACKEND_UNIT_STEP_BUDGET_SECONDS 720 → 900 for the shard step, with the measured distribution recorded in the env comment. Green runs pay nothing: the gate only ends over-budget runs later.
  • Shard job ceiling 25m → 30m so the ceiling still covers budget plus worst-plausible setup (72 + 90 + 570 + 900 = 1632s), preserving the invariant added for the cancelled-shard flake of 2026-10-22.
  • Contract pin in backend/tests/unit/test_workflow_contracts.py and the budget mention in backend/AGENTS.md updated to match.

The .github/workflows/backend-unit-tests.yml edit touches only this flake's own step and job ceiling; no new workflows, no skipped tests. Budget-raise-with-measured-evidence is the remedy David named for CI flake fixes (2026-10-22 standing ask); the alternative (widening the shard matrix) would trip the CI runner-minute budget ratchet (.github/ci-budget.yaml) and is better taken deliberately if the drift recurs — at the current growth rate (~13s/day on the max wall) this recalibration buys roughly a week and a half, and the env comment says so.

Verification

  • backend venv: pytest tests/unit/test_workflow_contracts.py — 94 passed.
  • pytest tests/unit/test_backend_unit_ci_runner.py — 13 passed.
  • .github/scripts/check_ci_budget.py — passed (inventory unaffected: matrix, triggers, runner, if, and needs are unchanged).
  • actionlint on the edited workflow — clean.
  • scripts/pr-preflight --suggest — no product-invariant citations required; no fix: commit, no failure-class declaration required.

View guided diff Turn on auto-fix

Full-suite selections grew 1727 -> ~2270 files since the six-shard
rebalance (#21259) sized ~288 files per shard under the 720s gate, so
shards now carry ~378 and their walls drifted past the line on
unrelated PRs: breaches 725/727/727/735/753s on 2026-10-24 (runs
40066874798 s1, 40061077340 s4, 40042164324 s4, 40065443584 s6,
40066103575 s6; near-misses 695/712/716s). No single file regressed —
per-file session cost is unchanged and the drift tracks selection
growth — so this is CI budget drift, not a product regression.

Raise BACKEND_UNIT_STEP_BUDGET_SECONDS 720 -> 900, holding the 753s
worst observed wall with 147s (19.5%) headroom, the same policy that
set 720 over the then-worst 602s (220c64b). Green runs pay nothing:
the gate only ends over-budget runs later. Raise the shard job ceiling
25m -> 30m so it still covers budget plus worst-plausible setup
(72+90+570+900 = 1632s), preserving the invariant documented for the
cancelled-shard flake of 2026-10-22.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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-24T06:42:57.526143Z 0a61924 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.

2 issues found across 4 files

Confidence score: 5/5

  • In .github/workflows/backend-unit-tests.yml, the shard header still says the regression gate is 720s, but the configured budget is 900s. Update the comment to 900s.
  • The apt step in .github/workflows/backend-unit-tests.yml has a 420s timeout, so the 570s setup estimate does not match the configured cap. Recalculate it so the 30m headroom comment is accurate.
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:174">
P3: The shard header comment still calls the gate 'the unchanged 720s regression gate', but the budget is now 900s. Update that sentence to reference 900s so the comment matches the env value.</violation>

<violation number="2" location=".github/workflows/backend-unit-tests.yml:175">
P3: The apt step is capped at 7m (`timeout-minutes: 7`), so it cannot consume the stated 570s/10m. Recalculate this setup estimate using the configured 420s cap so the 30m headroom comment matches the workflow.</violation>
</file>

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

View guided diff | Turn on auto-fix | Re-trigger cubic

# not the gate.
timeout-minutes: 25
# 39741901310, 39739120103, 39676205452, 39668020536). 30m holds the
# 900s step budget (2026-10-24 recalibration, see the env comment) plus

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 shard header comment still calls the gate 'the unchanged 720s regression gate', but the budget is now 900s. Update that sentence to reference 900s so the comment matches the env value.

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

<comment>The shard header comment still calls the gate 'the unchanged 720s regression gate', but the budget is now 900s. Update that sentence to reference 900s so the comment matches the env value.</comment>

<file context>
@@ -163,20 +163,21 @@ jobs:
-    # not the gate.
-    timeout-minutes: 25
+    # 39741901310, 39739120103, 39676205452, 39668020536). 30m holds the
+    # 900s step budget (2026-10-24 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, 2026-10-23) and
</file context>

Comment on lines +175 to +177
# worst-plausible setup with the apt step capped at 10m (72s worst
# checkout + ~90s toolchain + ~570s apt cold allowance, 2026-10-23) and
# teardown — 72+90+570+900 = 1632s, leaving 168s inside the line; slow

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 apt step is capped at 7m (timeout-minutes: 7), so it cannot consume the stated 570s/10m. Recalculate this setup estimate using the configured 420s cap so the 30m headroom comment matches the workflow.

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 apt step is capped at 7m (`timeout-minutes: 7`), so it cannot consume the stated 570s/10m. Recalculate this setup estimate using the configured 420s cap so the 30m headroom comment matches the workflow.</comment>

<file context>
@@ -163,20 +163,21 @@ jobs:
-    timeout-minutes: 25
+    # 39741901310, 39739120103, 39676205452, 39668020536). 30m holds the
+    # 900s step budget (2026-10-24 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, 2026-10-23) and
+    # teardown — 72+90+570+900 = 1632s, leaving 168s inside the line; slow
</file context>
Suggested change
# worst-plausible setup with the apt step capped at 10m (72s worst
# checkout + ~90s toolchain + ~570s apt cold allowance, 2026-10-23) and
# teardown — 72+90+570+900 = 1632s, leaving 168s inside the line; slow
# worst-plausible setup with the apt step capped at 7m (72s worst
# checkout + ~90s toolchain + 420s apt step, 2026-10-23) and teardown —
# 72+90+420+900 = 1482s, leaving 318s inside the line; slow

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Closing as a duplicate of #23692 — the same recalibration of the same lines (shard step budget, shard job ceiling, contract pin, nightly ledger, backend/AGENTS.md mention), cut from an earlier dispatch of this flake.

#23692 extends this PR's measured distribution: this PR's table stops at the 2026-10-24 753s worst; #23692 adds the 2026-10-26 breaches (727/841/746/808s, worst 841s in run 40267543640) and the decisive same-code re-run pair (808s fail → 719s pass, run 40278890153). Same target values throughout: BACKEND_UNIT_STEP_BUDGET_SECONDS 720→900 and the shard ceiling 25m→30m that keeps the 180s cache-save reserve. Keeping #23692 open as the single survivor; this branch is not rebased.

@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