ci: speed up Windows integration tests#595
Merged
Merged
Conversation
The Windows test jobs spend ~10 min compiling in the "Run tests" step while Ubuntu takes 1-2 min. The cache only stores third-party dependency artifacts; workspace crates, the per-file integration test binaries, and linking are recompiled every run, and that residual work is dominated by slow MSVC linking + Defender file scanning on Windows. Quick, CI-scoped wins (no structural change): - CARGO_PROFILE_DEV_DEBUG=line-tables-only: drop full debuginfo so object files are smaller and link faster; keeps file:line in backtraces. - Link windows-msvc with LLVM's lld-link (preinstalled on windows-2025) instead of link.exe. Scoped to this workflow, so the release/dist thin-LTO build keeps the default linker. - Exclude the workspace and .cargo/.rustup from Windows Defender real-time scanning in both the unit-tests and test jobs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
adamspofford-dfinity
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Windows
testjobs spend ~10 min compiling in the "Run tests" step while Ubuntu takes 1–2 min — and it's been this way regardless of PR. The Rust cache is working, but it only stores third-party dependency artifacts. By designSwatinem/rust-cachestrips workspace crates fromtarget/before saving (cache-workspace-crates: false), and the per-file integration test binaries (one pertests/*.rs) plus linking are never cached. So everytestjob recompiles the whole workspace and links its test binary from scratch. That residual work is ~1–2 min on Ubuntu but ~10 min on Windows because of slow MSVClink.exelinking, full debuginfo, and Defender real-time file scanning.Changes (quick, CI-scoped — no structural change)
All in
.github/workflows/test.yml:CARGO_PROFILE_DEV_DEBUG=line-tables-only— drop full debuginfo so object files are smaller and link faster; keepsfile:linein backtraces. Thetestprofile inherits this.lld-linkon windows-msvc — link with LLVM'slld-link(preinstalled atC:\Program Files\LLVMonwindows-2025, no install step) instead of the slowlink.exe. Only consumed when building the windows-msvc target → no-op on Linux/macOS. Scoped to this workflow, so the release/dist thin-LTO build keeps the default linker (lld + LTO has known segfault caveats)..cargo/.rustup, in both theunit-testsandtestjobs. Non-fatal so it can't break CI.Notes for reviewers
lld-linkswap is validated by this PR's Windows CI run (can't link MSVC locally from macOS). Iflld-link.exeisn't found at that path on some image variant, those jobs fail at link with an obvious "linker not found" error; the fix/revert is a one-line env change.unit-testsjob +cache-workspace-crates: trueso the paralleltestjobs reuse pre-built binaries instead of each recompiling the workspace. Larger payoff but grows caches and needs eviction-limit care.Verification
Confirmed against this PR's
Testrun on Windows:sync_testsspent 194s compiling/linking + 182s actually running tests (was ~10 min compile before). Jobs that hit the deps cache finished in ~380s end-to-end.lld-linkworks — all Windows jobs linked and passed; no "linker not found" errors, so LLVM'slld-linkis present and used onwindows-2025.unit-testshad just created — a transient warm-up effect, unrelated to the linker/debuginfo change. This clears once the new cache key is the norm acrossmainand open PRs, which is why the rollout plan is: merge this, then rebase/merge it into existing PRs so all future CI populates and reuses the new caches.🤖 Generated with Claude Code