Repository navigation
ci-flake: allowlist batch retry-cap closure test against the CPU duration guard - #23362
Merged
Git-on-my-level merged 2 commits intoOct 23, 2026
Merged
Conversation
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. |
…-glm-5-3/5e02664406c6 # Conflicts: # backend/tests/fast_unit_duration_allowlist.txt
Git-on-my-level
deleted the
agent/m1-studio-zcode-glm-5-3/5e02664406c6
branch
October 23, 2026 23:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI flake fixed at the root
cpu-duration-guard-test_runtime_image_contracts-gpu_batch_retry_cap-1.15s— the fast-unit CPU duration guard failedtests/unit/test_runtime_image_contracts.pywhentest_gpu_batch_retry_cap_does_not_reach_cloud_tasks's call phase exceeded the 1.00s fail budget.This is a standing CI-flake fix request from David (2026-10-22: every caught CI flake gets fixed at the root; caching and flake fixes approved). No
.github/changes — the fix is a single evidence-documented entry inbackend/tests/fast_unit_duration_allowlist.txt.Evidence it is a flake, not a regression
The test was added ~23:00Z on 2026-10-22 by #23358 (
ed2c03440d, the batch retry-cap closure regression). Every CI run of the identical code since then measured it right on the 1.00s budget — passing once by 0.02s and failing three times — while all 66 tests in the file passed in every run; the only failure output is the guard section:58d4c61a23, shard 2/6, 23:55Z58d4c61a23, shard 2/6, 23:33Zc39757a13a, shard 2/6, 00:25ZNo run before the test existed shows this signature (all failing
Backend Unit Testsruns back to 19:31Z on 10-22 were checked; the other failures are unrelated classes).Root cause
The test proves the batch worker's retry policy stays off Cloud Tasks. It walks the 109-module
batch-pipeline-workerfirst-party import closure twice —first_party_import_closure()for the first-party membership assertions, thenthird_party_dependency_modules()for thegoogle.cloud.tasksthird-party assertion; both AST-parse the same files. Measured on a quiet host: 0.136s + 0.139s = 0.275s CPU. On the hosted CI shard runners the same work reads 0.98–1.15s (slower per-core runners plus parallel-load CPU inflation, the phenomenon the guard's own docs measure at ~2x on a saturated host), landing exactly on the 1.00s fail budget — so every PR whose selection includes this file flakes on shard runners.Fix
Add the node ID to
backend/tests/fast_unit_duration_allowlist.txtwith the measured evidence — the repo's purpose-built mechanism for genuine unit tests whose measured CPU exceeds the failure threshold (three entries were added in the last 48h for this same CI-shard-at-the-limit shape, most recentlytest_batch_audio_language.py::test_admitted_short_false_permission_cannot_bypass_worker_barrier[zh-clean_speech-6s-pcm16]). The test keeps running at full strength in the unit lane; only the duration guard is suppressed for this node ID.Deliberately not done:
runtime_image_contracts.py: the two walks compute distinct contract facts with different import-candidate semantics (membership vs third-party probe); sharing one traversal would change a contract script that CI image gates depend on, and halving the cost would still leave ~0.5s on loaded runners with no deterministic margin over a budget the test already straddles by 0.02s margins.BACKEND_FAST_UNIT_FAIL_SECONDSbump: a global budget change weakens the guard for every other test; the per-node allowlist is the documented exception path.Local verification (nice -n 19)
The allowlist entry was additionally verified through
backend/tests/conftest.py::_read_duration_allowlist/_duration_allowlisted(node ID parses and matches, 360 entries).scripts/pr-preflight --suggest: lane=ci, no product-invariant citations, no failure-class declaration required.