ci(tests): seed pinned bats files by measured cost, not @test count (#847) - #1175
Merged
Conversation
…847) 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.
What
Re-fit the PINNED_APART seed in
.github/scripts/shard-tests.shso a pinnedheavy file is seeded into its shard by its measured cost, not by its
@testcount.Why
The pinned-apart files (#847/#848) wait far more than they compute, so their
@testcount (refusal 9, liveness 31) badly understates their real cost --that is the whole reason they are pinned. Seeding the pin at that count left
its shard looking almost empty, and the greedy LPT pass piled an average
count-share of other files on top of an already-679s file. On the first green
run to record per-file timings (#1159), that overfilled shard ran 1475s
while the others ran 636-737s.
Fix
Seed each pin at what its wall time is worth in average tests:
round(measured macOS wall / whole-suite avg s/test).Measured against GitHub Actions run
34664794167(#1159, tests.yml bats job,macos-latest, 5 shards): whole-suite macOS wall 4212s over 1749 @tests =>
avg 2.408 s/test. So refusal 679s -> 282, liveness 293s -> 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 1475s -> 987s.
The seed is tied to each file's OWN measured cost, not to a count the suite
outgrows, so it does not drift as the suite grows -- which is exactly what
#1107 was: a partition sized against a count baseline left behind as the suite
roughly tripled. The header now records what the values were measured against,
and that the numerator (per-file wall) and divisor (whole-suite avg) must be
refreshed together off one green run.
Safety
Placement is unchanged (
slot % total), so the pins still land in distinctshards.
tests/test_ci_sharding.batsstays green (11/11 locally), includingthe #847/#848 pin-separation and positive-control tests. CI-only change.