Repository navigation
Give Backend CI a timeout that is not the suite's runtime - #8286
danielhanchen wants to merge 1 commit into
Conversation
Every (Python ...) job that finished in the last 14 Backend CI runs took between 14.1 and 15.0 minutes, median 14.4, against timeout-minutes: 15. A job 4 percent slower than the median dies, so which ones survive is close to a coin flip and it is not interpreter specific: 3.10, 3.11, 3.12 and 3.13 all sit on the line. Cancelled durations are bimodal, 20 jobs under 3 minutes and 8 at exactly 15.2, so the short ones are ordinary supersede cancellations and the 15.2 cluster is this limit. gh pr checks reports a cancelled job as fail, which is why open PRs show red checks unrelated to their diff and why rerun --failed does not clear them: it does not pick up a cancelled job at all. Raise both jobs to 30. This is the guard against a hang, not a performance budget, and 30 still catches one inside a single CI cycle. Repo tests (CPU) measured 13.4 minutes against the same 15, so it gets the same treatment. The suite's own 14.5 minute runtime is the real problem and is not addressed here.
|
This PR's own first run is the evidence.
Both matrix jobs ran past 15 minutes and finished. Under the old limit they would have been cancelled at 15.2 and reported as What they finished with is the two failures main is currently red on, One correction to the numbers in the description. I quoted the job durations, but pytest itself is 13:54 to 14:45 and the job carries roughly 1.5 minutes of checkout, Python setup and install on top. So the effective budget for the suite under the old 15 minute job limit was closer to 13.5 minutes, which the suite had already outgrown. The margin was smaller than the completed-durations table suggests, and that is consistent with cancellations being the common case rather than the rare one. |
|
The full matrix has now reported, and it is a cleaner result than the two jobs I quoted above.
Four of four ran to completion, and three of the four exceeded the old budget. So on this branch the previous configuration would have reported one verdict and three cancellations, which is the coin flip described in the body rather than a slow outlier. All four fail on the same two tests main is red on, fixed by #8281. Nothing here is specific to this branch: it is a workflow-only change off main. |
|
Since the description says the suite's runtime is the real problem and this PR does not touch it, here is the measurement, so the follow-up is not a guess. Full backend suite, CPU only to match CI, 716s. The 60 slowest tests account for 259s, 36% of the run. There is no hot spot. The other 64% is roughly 20,000 tests at about 35ms each. Worst modules, for completeness:
That changes what the fix should be. Splitting the slow modules into their own job buys very little, because they are not where the time is. The lever is parallelism: A second, cheaper option worth a separate decision: the matrix runs the whole suite on 3.10, 3.11, 3.12 and 3.13, and Neither belongs in this PR. Recording it here so the 30 is understood as a floor rather than the answer. |
|
Reading the red here by job conclusion rather than by
The raised budget is already doing what it is for: 3.10, 3.11 and 3.12 all ran past 15 minutes and finished instead of being cancelled mid-suite, so for the first time all four interpreters report a verdict. The verdict is Those two are the pre-existing main breakage from #8236 and are unrelated to this workflow change. #8281 fixes them, and the two PRs are complementary: #8281 clears the failures but leaves 3.10 and 3.11 cancelled at 15m08s and 15m09s, and this one clears the cancels but leaves the four failures. I will merge main into this branch once #8281 lands so this can show all four interpreters green, then this is ready. Worth recording separately: the suite is at 13 to 16 minutes and still climbing, so 30 buys time rather than headroom. The runtime itself needs its own look. |
|
Superseded by #8281, which now carries this same two-line change. Not because the measurement here was wrong, but because splitting it from the test fix meant neither PR could show a green Backend CI. This one lets all four interpreters finish and they then fail on the two tests #8281 fixes; #8281 fixes those and leaves the timeout, so a different interpreter is cancelled each run. Whichever went first had to be merged over a red check. Leaving this open until #8281 lands, in case that ordering turns out to be preferable after all. Once it does, I will close this and the measurement stays on the record here. The finding underneath is unchanged and still worth acting on separately: every job that finished took 14.1 to 15.0 minutes against a 15 minute budget, median 14.4, and pytest itself is 13:54 to 14:45 with roughly 1.5 minutes of job overhead on top. Raising the cap to 30 buys time, not headroom. The suite's runtime is the actual problem. |
Backend CI jobs have been getting cancelled at a high rate across every open PR, and the cancellations read as
failingh pr checks, so PRs look red for reasons that have nothing to do with their diff. #8274 currently shows 52 red checks and not one of them is a real failure.The measurement
Every
(Python ...)job across the last 14 Backend CI runs, by wall time and outcome:The cancellations are bimodal. The 20 jobs under 3 minutes are ordinary supersede cancellations, a new push killing an in-flight run, and those are fine. The 8 at 15.2 are the job hitting
timeout-minutes: 15.The completed column is the real finding: every job that finished took between 14.1 and 15.0 minutes against a 15 minute budget. The median is 14.4. A job that runs 4% slower than the median dies, so which ones survive is close to a coin flip per run, and it is not interpreter-specific: 3.10, 3.11, 3.12 and 3.13 all sit on the same line.
That is why the same PR shows different red checks on each re-run, and why re-running "failed" jobs has not helped:
gh run rerun --faileddoes not pick up a cancelled job at all.The change
timeout-minutes: 15to30, on the pytest matrix and onRepo tests (CPU), which measured 13.4 minutes against the same limit.This is the guard against a hung job, not a performance budget, and 30 minutes still catches a hang inside one CI cycle. Nothing else changes.
What this does not fix
A unit-test suite that takes 14.5 minutes is the actual problem, and this only stops it being scored as a coin flip. Worth doing properly afterwards: the matrix runs the whole of
studio/backend/testsfour times over, andpytest-xdistor splitting the slow modules out would cut it a long way. I did not want to put a behaviour change and a scheduling change in the same PR, and the timeout is what is blocking the queue today.Verification
The workflow parses and both jobs read 30:
No test or product code is touched, so the evidence that matters is this PR's own Backend CI going green without a cancellation.