Skip to content

ci: record per-file bats timings - #1159

Merged
fujibee merged 5 commits into
mainfrom
ci/1107-bats-timings
Sep 13, 2026
Merged

ci: record per-file bats timings#1159
fujibee merged 5 commits into
mainfrom
ci/1107-bats-timings

Conversation

@fujibee

@fujibee fujibee commented Sep 11, 2026

Copy link
Copy Markdown
Owner

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.sh
  • git diff --check

This adds measurement for #1107; it does not claim to fix the shard imbalance yet.

@fujibee
fujibee merged commit 99a3e9e into main Sep 13, 2026
24 checks passed
@fujibee
fujibee deleted the ci/1107-bats-timings branch September 13, 2026 00:37
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant