Repository navigation
perf(ci): cut test job time and guard its mean - #2764
Merged
Merged
Conversation
Plans #2699. The change folder holds the baseline of the Tests & Coverage job on the runner (24 runs), the design with the rejected alternatives, the spec delta of devops ci job-time, and the tasks.
Adds devops ci job-time. It reads the time of a job in the last successful push runs of a workflow on a branch from the Actions API, and fails when the mean is over the limit or when fewer runs than asked for were read. The job Test Job Duration of ci.yml runs it after each push to main and every day. The test job cannot be the guard: a pull request has one run, and a guard there fails the pull request that fixes the time. The read is tested offline over the fake of the GitHub API with recorded runs of main.
The Tests & Coverage job took 372 s on average on the runner, 92% of it in the test step. Each of the 13,900 tests paid for work that it did not ask for. No test is skipped or changed, and no threshold moves. - tmp_path_retention_policy is failed, and the runtime directory of a test is made without a number: pytest listed the whole base directory for each numbered directory. - The LLM response cache is built on first use, not in an autouse fixture that loaded the settings for every test. - The young threshold of the garbage collector is 50,000. - Five test servers poll their shutdown every 0.01 s. - The click command of a Typer app is built once for each state of the app, not for each CliRunner.invoke. - The parse cache of the Markdown helper is keyed by the text, since a path can be reused now. Same 13,918 tests plus 17 new ones, same coverage (93.73%). On 4 pinned CPUs the run takes 0.75 of the time of the base.
Archives 2699-test-check-time and adds the ci-job-time spec.
The guard listed only successful runs. The run that the guard turned red left the next window, so a slow window could clear itself. A slow run that failed was never seen. List completed runs and read the conclusion of the job: success, failure and timed_out count.
State the measured ratio of the cut, the expected red of the guard after the merge, and the rule that the job conclusion decides.
Owner
Author
Run of this pull request, measuredSource: Actions API, run 41020014773, job
The job took 0.65 of the baseline mean. Without the 8 s step that a push does not run, it took about 234 s. Limits of this number:
This pull request uses |
dan-petty
marked this pull request as ready for review
October 30, 2026 07:31
dan-petty
pushed a commit
that referenced
this pull request
Oct 30, 2026
🤖 I have created a release *beep* *boop* --- ## [0.22.1](v0.22.0...v0.22.1) (2026-10-30) ### Bug Fixes * **github:** ask no traffic endpoint as the App ([#2759](#2759)) ([692c15f](692c15f)), closes [#2752](#2752) * **roadmap:** a stop of the Service is not a failed round ([#2756](#2756)) ([0b7e190](0b7e190)), closes [#2753](#2753) * **roadmap:** say why an implement step stopped ([#2762](#2762)) ([cd56ce4](cd56ce4)), closes [#2758](#2758) * **service:** render and alert on the hourly request budget ([#2760](#2760)) ([809d85b](809d85b)), closes [#2755](#2755) * **service:** run the implement row on the status lane ([#2763](#2763)) ([cd94f2c](cd94f2c)), closes [#2757](#2757) ### Performance Improvements * **ci:** cut test job time and guard its mean ([#2764](#2764)) ([e76f656](e76f656)), closes [#2699](#2699) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
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.
What
The required check
Tests & Coverageaveraged 372 s over 24 runs ofmain. The newest 10 averaged 387 s. AGENTS.md rule 5 makes this a P0 bug. This change does two things.tmp_path_retention_policy = "failed"and one runtime directory per worker.devops ci job-timeand the jobTest Job Durationinci.yml. The job runs on push tomainand every day. It reads the last 10 completed runs from the Actions API. It counts a job that passed, failed or timed out, whatever the run concluded. It fails when the mean is over 300 s or fewer than 10 runs were read.Why
A pull request has one run, so it cannot show a mean. The history of
maincan. Reading the job's own conclusion keeps the run that the guard turned red in the next window.Result and open points
mainare the proof.Test Job Durationis expected to be red on the merge push and on about 8 pushes after it. Its window still holds the slow runs. This is not a regression.mainread under 300 s.Plans #2699