Skip to content

perf(ci): split Test job from Check to meet 2-minute target (#106) - #161

Merged
zackees merged 1 commit into
mainfrom
perf/ci-check-tighten
May 11, 2026
Merged

zackees merged 1 commit into
mainfrom
perf/ci-check-tighten

Conversation

@zackees

@zackees zackees commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes the gap toward #106: warm Check jobs were over 2 minutes mostly because cargo test --workspace --no-fail-fast ran inside the same job as cargo check. This PR moves the test step into a separate test job that runs in parallel, so each platform Check job reports compile status under 2 minutes.

Rationale (why this over alternatives)

Measured the latest warm-cache main runs:

Platform Total setup-soldr Check step Test step
linux (run 25643337173) 1m52s 56s 7s 40s
macos (run 25643337181) 3m40s 64s 17s 2m6s
windows (run 25643337180) 9m26s 32s 2m27s 6m15s (fail)

The Test step dominates everywhere except Windows (where Check itself is ~2m27s). Splitting Test out is the highest-leverage move and matches the issue's suggestion: "tests should be split into faster platform smoke checks plus a full test job."

Considered and rejected:

  • Drop --all-targets from Check: loses test-build coverage on PRs; small wins.
  • Drop the Stop zccache shim: only ~1s on Linux/macOS.
  • Cache layout tuning: already tried in ci: restore full setup-soldr target cache #105 and is at current best.

Expected per-platform impact (warm cache)

Platform Check job before Check job after Delta
linux / Check 1m52s ~1m12s -40s
macos / Check 3m40s ~1m34s -2m6s
windows / Check 5m22s* ~3m -2m22s

*Windows Check job total prior to Test step start (latest warm run). Windows Check step alone is ~2m27s — still over the bar, but Test failure is no longer coupled to the Check signal.

The new Test job still pays the full test-compile-and-run cost, but it runs in parallel and no longer blocks the Check criterion.

Test plan

  • PR run: confirm linux / Check warm-cache duration ~1m12s
  • PR run: confirm macos / Check warm-cache duration ~1m34s
  • PR run: confirm windows / Check warm-cache duration ~3m or less
  • PR run: confirm new test job runs (and that Windows Test still fails — pre-existing red, not blocking)
  • Cache restore-keys: both jobs hit the same warm cache (parallel setup-soldr)

Refs: #106 #101 #105

Per #106, warm Check jobs were over 2 minutes mostly
because cargo test --workspace --no-fail-fast compiled and ran every
test binary in the same job as cargo check. Splitting the test step
into a separate `test` job lets the platform Check jobs report compile
status under 2 minutes while preserving the full test signal in a
parallel job.

Expected warm-cache impact (vs main run 25643337173 / 81 / 80):
- linux / Check:   1m52s -> ~1m12s (-40s)
- macos / Check:   3m40s -> ~1m34s (-2m6s)
- windows / Check: 5m22s -> ~3m (Check step still dominates; Test
  failure becomes its own job and stops blocking the Check signal)

The Stop zccache step is duplicated into the new job so cache save
on cancellation remains safe in both lanes. No required-status-check
update needed: the repo has no branch protection on main.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zackees

zackees commented May 11, 2026

Copy link
Copy Markdown
Collaborator Author

Measured warm-cache impact

Platform Before (main) After (this PR) Delta
linux / Check 1m52s 1m10s -42s (under 2m)
macos / Check 3m40s 1m23s -2m17s (under 2m)
windows / Check ~5m22s 3m44s -1m38s (Check step compile is 2m29s on Windows, bottleneck)

All three platforms saw >= 10s improvement; no new failures. The pre-existing windows / Test red is now isolated in the new test job and no longer blocks the Check signal.

Linux and macOS now meet the issue #106 acceptance bar (≤ 2 minutes warm Check). Windows is bottlenecked on the compile step itself, which is not addressable in this PR's scope.

Linux PR run: https://github.com/zackees/zccache/actions/runs/25650159329
macOS PR run: https://github.com/zackees/zccache/actions/runs/25650159333
Windows PR run: https://github.com/zackees/zccache/actions/runs/25650159340

@zackees
zackees merged commit 397b48b into main May 11, 2026
11 of 12 checks passed
@zackees
zackees deleted the perf/ci-check-tighten branch May 11, 2026 04:32
zackees added a commit that referenced this pull request May 11, 2026
) (#164)

Check existed as a fast compile gate; --all-targets pulled in tests,
benches, and examples which is exactly what the parallel Test job already
covers. Removing it makes Check a true lib+bins smoke check and shifts
test-build coverage entirely to the Test job (no signal lost — both jobs
start at the same time, so time-to-detection of a broken test build is
unchanged).

Why now: latest warm-main timings put Linux Check at 1m9s and macOS Check
at 1m29s — under the 2-minute target — but Windows Check is 3m41s with
the cargo check step alone consuming 2m45s. The earlier #161 author
considered this change but did not measure it. Empirically validating on
the slow path is the next step.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request May 11, 2026
…on job (#165)

Issue #106 — keep platform Check / Test jobs under ~2 minutes.

PR #161 split Test into its own job; PR #164 trimmed --all-targets from
Check. The remaining bottleneck is `cargo test --workspace --no-fail-fast`
on Windows: it compiles every integration test binary under
`crates/*/tests/` even though most of their tests are #[ignore]'d. Each
of the 17 integration test files in zccache-daemon alone becomes its own
MSVC-linked binary, costing ~4m of Windows test-compile per run.

Two-lane split:

1. **Platform Test** (`ci-check.yml`) runs `cargo test --workspace
   --lib --bins --no-fail-fast` on Linux / macOS / Windows. This still
   exercises every library unit test (110 in zccache-compiler, 60 in
   zccache-fingerprint, etc.) and every binary unit test, but skips
   compiling the integration test binaries.

2. **Integration** (new `integration.yml`) runs `cargo test --workspace
   --no-fail-fast` on `ubuntu-latest` only. Linux test-compile is
   fastest by 10×+ and the integration tests that matter on Windows
   are already gated behind `#[cfg(windows)]` modules whose unit tests
   run in the platform Test job.

Also adds simple per-step timing to `$GITHUB_STEP_SUMMARY` so warm/cold
regressions are visible in the PR summary instead of needing a raw log
inspection.

No coverage lost: every test that runs today still runs, just possibly
in a different lane.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request May 11, 2026
Patch bump covering everything merged since v1.4.0:

- fix(daemon,ci): tolerate unknown sessions and stop killing soldr's
  daemon (#168, closes #166 + #167)
- feat(cli): expose session_end_idempotent for all daemon callers (#163)
- fix(daemon): deterministic flush primitive for event log (#162)
- feat(cli,daemon): relocate daemon exe to global runtime-binaries dir (#158)
- fix(depgraph): normalize workspace-path inputs out of rustc cache key (#160)
- perf(ci): trim platform Test, drop --all-targets from Check, split
  Test/Check jobs (#161, #164, #165)
- chore(ci): drop invalid target-cache-paths from build-target action (#157)

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request May 12, 2026
…#173)

* perf(ci): dogfood zccache action for Check/Test to hit 2-minute target (#106)

ci-check.yml now uses this repo's own ./ action (RUSTC_WRAPPER=zccache +
target snapshot + `zccache warm` + mtime touching) instead of
zackees/setup-soldr@v0 (target/ blob cache only). On warm runs cargo's
fingerprint should see no dirty files, dropping `cargo check --workspace`
from 135s -> tens of seconds on Windows.

Why: After #161, #164, #165 cut work, Windows Check is stuck at 3:15
because `setup-soldr`'s target blob cache doesn't engage zccache as a
rustc wrapper and doesn't normalize mtimes. The ./ action (validated
cross-platform by test-action.yml on Linux x64/arm, macOS 14/15,
Windows 2025 x64/arm) does both.

Side wins:
- Drops the 30-line `python - <<PY` cleanup block in favor of
  ./action/cleanup (which saves caches, stops the daemon, builds the
  target snapshot).
- Drops the bundled-zccache 1.4.0 soldr at-exit teardown carve-out
  (a659804) — no soldr in CI means no soldr session-end errors to
  ignore.
- Splits Check/Test cache namespaces via shared-key so they don't
  poison each other.

PR #102's `hot` regression doesn't apply: that was setup-soldr's
target-cache-mode: hot, a different implementation. The ./ action's
target-snapshot-mode (hot is the default) is the path validated by
test-action.yml.

Verification on this PR's CI:
  1) First run primes the new cache keys; expect Check ~current.
  2) Empty-commit second run is the decisive measurement.
  3) Target acceptance: macOS/Linux/Windows Check each <=2:00 warm.
  4) Fallback: revert to setup-soldr if Windows regresses.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* style(ci): apply rustfmt to cross-check-linux command in zccache-ci

The `Formatting` CI job on PR #173 caught that the cross-check-linux
build_cmd call in `crates/zccache-ci/src/main.rs:228` exceeded the 100-col
limit. rustfmt's verdict is the multi-line array form. This is a pure
whitespace fix — no behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* ci: empty commit to measure warm-cache PR run for #106

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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