You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Serialize cluster image builds and split CLI tests into separate CI job (#338)
Two changes to improve CI reliability:
**Serialize cluster image builds with file lock**
The `AlreadyExists` fix in #337 handled one symptom of parallel xdist
workers racing to build the same cluster image, but there's a second
failure mode showing up in CI:
https://github.com/chrisguidry/docket/actions/runs/22025132964/job/63640478732
When concurrent builds target the same tag, the Docker SDK's `build()`
completes successfully in the daemon, then tries to inspect the
resulting image by its short ID. If another worker's build re-tagged the
image in the meantime, the first image ID gets orphaned and the inspect
404s. This knocked out 485 of 686 tests in the cluster job.
Rather than catching yet another exception type, this serializes the
builds with `fcntl.flock` so only one worker builds at a time. The
others wait and find it already built. Eliminates both the
`AlreadyExists` and `ImageNotFound` races structurally.
**Split CLI tests into separate CI job**
Cluster CI jobs consistently run right at the 4-minute timeout, and when
any test runs slightly slow the whole job gets cancelled. This has been
showing up in roughly a third of recent CI runs:
https://github.com/chrisguidry/docket/actions/runs/22025359927/job/63641245074
The 91 CLI tests are subprocess-based and don't exercise
backend-specific behavior — they spawn `python -m docket ...` processes
and check output. Running them against every Python x Backend
combination (30 matrix entries) is wasted effort.
This moves CLI tests to their own job that varies by Python version but
uses a single Redis backend (8.0). The main test matrix now passes
`--ignore=tests/cli` so cluster/valkey/memory jobs only run the tests
that actually care about the backend. Local `pytest` runs are
unaffected.
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments