Skip to content

[CI] Allow test_free_tier_basic_gates YAML parse in fast-unit duration guard (#22000) - #22005

Merged
kodjima33 merged 1 commit into
BasedHardware:mainfrom
PINYOPATTANAWASANPORN:fix/fast-unit-duration-allowlist-free-tier-gates-22000
Oct 18, 2026
Merged

kodjima33 merged 1 commit into
BasedHardware:mainfrom
PINYOPATTANAWASANPORN:fix/fast-unit-duration-allowlist-free-tier-gates-22000

Conversation

@PINYOPATTANAWASANPORN

@PINYOPATTANAWASANPORN PINYOPATTANAWASANPORN commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Failure-Class: none

Summary of Changes

Exempts tests/unit/test_free_tier_basic_gates.py::test_dev_lights_each_gate_on_the_identities_that_run_its_code_path from the fast-unit duration guard in backend/tests/fast_unit_duration_allowlist.txt.

Root Cause / Technical Context

Main CI on BasedHardware/omi reported red on Issue #22000 (Run 39009717558, SHA 61803e04ca). Investigation of the shard 4/6 execution log revealed:

2026-10-17T06:28:38.6806644Z 1.01s > 1.00s tests/unit/test_free_tier_basic_gates.py::test_dev_lights_each_gate_on_the_identities_that_run_its_code_path
2026-10-17T06:28:38.6866453Z BACKEND-UNIT-FAILED-FILE tests/unit/test_free_tier_basic_gates.py
2026-10-17T06:28:38.8407067Z ##[error]tests/unit/test_free_tier_basic_gates.py exited with status 1

test_dev_lights_each_gate_on_the_identities_that_run_its_code_path is the first test in test_free_tier_basic_gates.py to invoke @functools.cache def _composed(), which reads and parses backend/deploy/runtime_env.yaml (248 KB). Under parallel CI runner contention, PyYAML SafeLoader execution in the call phase measured 1.01s CPU, marginally exceeding the 1.00s hard fail budget while all assertions passed. Subsequent tests in the suite hit cache in <0.001s.

Following the precedent set for test_conversation_notes_v2_beta_rollout.py and test_plan_quota_env_retirement.py, this test is added to fast_unit_duration_allowlist.txt to prevent contention flakes without relaxing the global fast-unit duration threshold.

Verification & Testing

  • Verified parse and matching against conftest._read_duration_allowlist() and _enforce_fast_unit_duration_guard():
    • Exemption correctly resolved: True
    • Duration offenders count above 1.00s: 0
  • Verified diff surface area: exactly +2 lines in backend/tests/fast_unit_duration_allowlist.txt with zero modifications to test code or logic.

Impact & Compatibility

View guided diff

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the single changed file and the guard machinery it feeds.

The diff itself checks out. backend/tests/fast_unit_duration_allowlist.txt (+2 lines) adds a dated comment and the nodeid tests/unit/test_free_tier_basic_gates.py::test_dev_lights_each_gate_on_the_identities_that_run_its_code_path. Verified:

  • The test exists on main at tests/unit/test_free_tier_basic_gates.py:95, and main's allowlist does not already contain it — the exemption is new, not duplicated.
  • The entry format parses correctly under conftest._read_duration_allowlist() (comment stripping + optional backend/ prefix removal), and _enforce_fast_unit_duration_guard() exempts exactly this nodeid from the 1.00s hard-fail budget while its assertions still run. The global threshold is untouched.
  • The comment-plus-entry style matches the precedent entries directly above (e.g. the 2026-10-16 test_dream_replay.py entry), and the 1.01s-vs-1.00s CPU overrun under runner load matches the #22000 log you quoted.

One blocker, and it's metadata rather than code: the Hygiene check fails in failure-class-protocol with missing_declaration — because the commit subject begins with fix:, the PR body must carry a Failure-Class: declaration. Please add exactly one accepted form to the PR description:

Failure-Class: none

(or Failure-Class: new / Failure-Class: FC-<lower-kebab-slug> if you believe this fix maps to a semantic failure class). This is a PR-description edit only; no code change is needed, and once it lands the change looks good from my side.

This feedback is AI-generated on behalf of the maintainer team.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added the backend Backend Task (python) label Oct 17, 2026
@PINYOPATTANAWASANPORN

Copy link
Copy Markdown
Contributor Author

Added Failure-Class: none to the PR description as requested. Thank you for the review!

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Legit 2-line CI test-allowlist fix (closes #22000, verified root cause and precedent format); not a workflow-file change, no abuse signal. DIRTY mergeStateStatus blocks merge per policy -- approve-only.

@PINYOPATTANAWASANPORN
PINYOPATTANAWASANPORN force-pushed the fix/fast-unit-duration-allowlist-free-tier-gates-22000 branch from a837f1e to adf6dde Compare October 17, 2026 22:11
@Git-on-my-level
Git-on-my-level dismissed their stale review October 18, 2026 11:24

Dismissing as resolved: the PR description now declares 'Failure-Class: none' and the Hygiene check passes on the current head; no remaining concerns from this review.

@Git-on-my-level

Copy link
Copy Markdown
Member

Since my last review: addressed (the PR description now declares Failure-Class: none, and the Hygiene check passes on the current head) · still open (nothing) · newly introduced (nothing).

The change is correct and complete as far as I can verify — the one metadata blocker from my earlier review is resolved, and a maintainer has already approved.

Re-verified on the current head:

  • backend/tests/fast_unit_duration_allowlist.txt (+2): the dated comment and the nodeid tests/unit/test_free_tier_basic_gates.py::test_dev_lights_each_gate_on_the_identities_that_run_its_code_path are the entire diff; the entry is not already on main and not duplicated.
  • The root-cause claim checks out in code: test_dev_lights_each_gate_on_the_identities_that_run_its_code_path (line 95) is the first caller of _composed() (line 34, @functools.cache), which reads and parses deploy/runtime_env.yaml in the call phase — consistent with the 1.01s-vs-1.00s overrun quoted from the [loop-c] main CI red: gha-FAIL: backend unit shards result was 'failure' #22000 log.
  • The exemption scopes to exactly this nodeid: assertions still run, the global 1.00s fast-unit threshold is untouched, and the entry style matches the precedent entries directly above it.

Performance: no production code changes; the only effect is that one known-slow test's YAML parse no longer hard-fails the fast-unit guard under runner contention. Blast radius: backend CI only.

USER IMPACT: none — internal change; this only stops a CI flake, nothing a user will notice.

Nothing further needed from me; leaving the merge decision with the maintainers.

This feedback is AI-generated on behalf of the maintainer team.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added the positive-signal Automation verified a genuine fix/quality contribution label Oct 18, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

2-line CI test-allowlist fix (closes #22000), root cause verified against precedent, CI green, mergeStateStatus previously DIRTY/now uncomputed - attempt merge, fall back to approve if conflict confirmed.

@kodjima33
kodjima33 merged commit 8efd485 into BasedHardware:main Oct 18, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend Task (python) positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[loop-c] main CI red: gha-FAIL: backend unit shards result was 'failure'

3 participants