Skip to content

Split the tests and cancel only the expensive job - #172

Merged
jcschaff merged 1 commit into
mainfrom
ci/split-and-cancel-expensive-tests
Sep 12, 2026
Merged

jcschaff merged 1 commit into
mainfrom
ci/split-and-cancel-expensive-tests

Conversation

@jcschaff

Copy link
Copy Markdown
Contributor

Adds concurrency with cancel-in-progress, scoped as asked to the expensive tests only. Scoping it usefully first required splitting the cheap work from the expensive work, so that is here too.

The split

Job Selection Interpreters Time
tests -m "not slurm" 3.13 and 3.14 ~1m
tests-slurm -m slurm 3.14 only ~6m

The two selections cover every test exactly once. Verified by collection count rather than asserted: 26 + 21 = 47, against 47 collected overall.

Cancellation is on tests-slurm alone

It is the only job where abandoning a superseded run saves anything worth having. The others finish in under a minute, and cancelling them would only make their status harder to read.

Only pull-request runs are abandoned, so a push to main keeps its run rather than carrying a cancelled and therefore ambiguous status.

A comment records the trap for whoever later gives this job a matrix: the matrix value has to go into the group key, or every leg shares one group and the legs cancel each other.

Two things that fell out of the split

The duplicate mypy is gone. make check in quality already runs it, so the Check typing step was running the type checker a second and third time on every matrix leg.

The expensive job runs on one interpreter, deliberately. It exercises the scheduler, SSH and the container build rather than anything version-specific, and running it twice cost more than the whole rest of CI put together. 3.14 is what production runs, per .python-version. The fast job still covers both. This is a coverage trade rather than a free win, which is why it is stated in the workflow, in the plan document, and here rather than left implied — say so if you would rather keep the full matrix and pay the time.

What it costs and saves

before after
runner time per push ~13m ~9m
time to hear about a typical failure ~6m ~1m

Combined with deleting the duplicate workflow in #171, runner time per push has gone from about 25 minutes to about 9.

🤖 Generated with Claude Code

https://claude.ai/code/session_018TgVbCXXWAWhNjtKTzrxvN

`tests-and-type-check` became two jobs, because scoping cancellation usefully
first required separating the cheap work from the expensive work.

    tests        -m "not slurm"   3.13 and 3.14   ~1m
    tests-slurm  -m slurm         3.14 only       ~6m

The two selections cover every test exactly once, verified by collection count:
26 + 21 = 47.

**Cancellation is scoped to `tests-slurm` alone.** It is the only job where
abandoning a superseded run saves anything worth having; the others finish in
under a minute and cancelling them would only make their status harder to read.
Only pull-request runs are abandoned, so a push to `main` keeps its run rather
than carrying a cancelled and therefore ambiguous status. A comment records the
trap for anyone who later gives this job a matrix: the matrix value has to go
into the group key, or the legs share one group and cancel each other.

**The duplicate mypy is gone.** `make check` in `quality` already runs it, so
the `Check typing` step was running the type checker a second and third time on
every matrix leg.

**The expensive job runs on one interpreter, deliberately.** It exercises the
scheduler, SSH and the container build rather than anything version-specific,
and running it twice cost more than the whole rest of CI put together. 3.14 is
what production runs. The fast job still covers both interpreters. This is a
coverage trade rather than a free win, so it is stated in the workflow and in
the plan rather than left implied.

Net runner time per push goes from roughly 13 minutes to roughly 9, and the
failure modes that fire most often now report in about a minute instead of
after six.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018TgVbCXXWAWhNjtKTzrxvN
@jcschaff
jcschaff force-pushed the ci/split-and-cancel-expensive-tests branch from 172b525 to 552bc3b Compare September 12, 2026 19:24
@jcschaff
jcschaff merged commit 90feedd into main Sep 12, 2026
11 checks passed
@jcschaff
jcschaff deleted the ci/split-and-cancel-expensive-tests branch September 12, 2026 22:59
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