ci: record per-file bats timings - #1159
Merged
Merged
Conversation
fujibee
added a commit
that referenced
this pull request
Sep 13, 2026
…847) (#1175) The pinned-apart heavy files (#847/#848) were seeded into their shards at their @test count (file_weight): refusal 9, liveness 31. That count is exactly the metric these files defeat -- both wait far more than they compute -- so a 9-unit seed left refusal's shard looking almost empty and the greedy LPT pass piled an average count-share of other files on top of an already-679s file. Measured on the first green run to record per-file timings (#1159), that overfilled shard ran 1475s while the others ran 636-737s. Seed each pinned file instead at what its measured wall time is worth in average tests: round(measured macOS wall / whole-suite avg s/test). Off run 34664794167 (4212s over 1749 @tests => 2.408 s/test) that is refusal 282, liveness 122. Simulating the partition against the measured per-file seconds (the simulator reproduces the observed 1475s under the old seed, so it is trustworthy) brings the worst shard from 1475s to 987s. The seed is tied to each file's OWN measured cost rather than to a count the suite outgrows, so it does not drift as the suite grows -- which is what #1107 actually was, a partition sized against a count baseline left behind as the suite roughly tripled. The header records what the values were measured against and that numerator and divisor must be refreshed together. Placement is unchanged (slot % total), so the pins still land in distinct shards; tests/test_ci_sharding.bats stays green (11/11).
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.
Summary
(1) Run each shard one Bats file at a time and record start, end, elapsed seconds, and exit status in an append-only TSV artifact.
(2) Preserve a file-start row and shard summary when the runner receives INT or TERM, so a job cancelled at its wall-clock cap still explains which file was active and what had already completed.
(3) Add a reusable summarizer for cross-run per-file p50/p95/max timings and per-run maximum-shard headroom against the job timeout.
Verification
bats tests/test_ci_sharding.bats(17 tests)bats tests/test_ci_workflow.bats(6 tests)bash -n .github/scripts/run-bats-timed.sh .github/scripts/summarize-bats-timings.shgit diff --checkThis adds measurement for #1107; it does not claim to fix the shard imbalance yet.