Skip to content

Cache test-data zips in CI - #37

Merged
cboulay merged 1 commit into
devfrom
ci/cache-test-data
Aug 2, 2026
Merged

Cache test-data zips in CI#37
cboulay merged 1 commit into
devfrom
ci/cache-test-data

Conversation

@cboulay

@cboulay cboulay commented Aug 2, 2026

Copy link
Copy Markdown
Member

Follow-up to the transient-500 flake seen on #36: every matrix job downloads the CereLink test datasets (and, for integration, nPlayServer) fresh from GitHub's release-asset CDN, so a single CDN blip anywhere in the 14 jobs fails the build, and each run re-pays ~40 MB of downloads. This restores tests/.test_cache/*.zip with actions/cacheconftest.py already skips any download whose zip exists, and extraction is cheap, so caching the zips alone is sufficient.

Design notes, since cache keys are where this kind of thing goes quietly wrong:

  • Key = OS + hash of tests/conftest.py, which holds the release URL and asset names — bumping the data version invalidates the cache automatically.
  • Deliberately no prefix restore-keys. The zip filenames are unversioned (dnss256.zip), so a stale zip restored across a version bump would be silently used as current data. A conftest edit therefore costs one re-download per OS, which is the safe direction.
  • The integration job gets its own key with a same-hash fallback to the unit key. The unit jobs finish first and save the shared key without nPlayServer-*.zip; without a separate key the nPlay binary would never be cached. The fallback is safe because it carries the same conftest hash, so restored zips are current and only nPlayServer is fetched on top.
  • Pushes to dev now run the workflow. PR caches are branch-scoped and can only read caches from their base branch; previously nothing ran on dev, so no shared cache would ever exist and each PR would rebuild its own from scratch.
  • actions/cache skips its save step when the job fails, so a failed/interrupted download can't poison the cache (and Optimize SamplingDelayAlignment for MLX and right-size its fractional-delay FIR #36 additionally makes the conftest download atomic via a .part rename).

First run after merge populates the dev cache; subsequent PR runs should show "Cache restored" and skip the Downloading … lines in the pytest output.

🤖 Generated with Claude Code

Every matrix job downloads the CereLink test datasets (and, for
integration, nPlayServer) fresh from GitHub's release-asset CDN, so one
CDN blip anywhere in the 14 jobs fails the build -- as happened on PR
#36 -- and each run pays ~40 MB of downloads it already did last time.

Restore tests/.test_cache/*.zip with actions/cache; conftest.py already
skips any download whose zip exists, and extraction is re-done cheaply.
The key hashes conftest.py, which holds the release URL and asset names,
so bumping the data version invalidates the cache. Deliberately no
prefix restore-keys: the zip filenames are unversioned, so a stale
dnss256.zip restored across a version bump would be silently used as
current. The integration job gets its own key (it alone caches
nPlayServer) with a same-hash fallback to the unit key.

Pushes to dev now also run the workflow: PR caches are branch-scoped and
can only read from their base branch, so without a run on dev merges,
nothing would populate the cache PRs restore from.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cboulay
cboulay merged commit 2ff53fe into dev Aug 2, 2026
16 checks passed
@cboulay
cboulay deleted the ci/cache-test-data branch August 2, 2026 20:42
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