Skip to content

chore(ci): optimize Windows go test with warm build cache strategy#507

Merged
fansenze merged 1 commit intomainfrom
chore/remove-windows-batch-test-20260317
Mar 17, 2026
Merged

chore(ci): optimize Windows go test with warm build cache strategy#507
fansenze merged 1 commit intomainfrom
chore/remove-windows-batch-test-20260317

Conversation

@fansenze
Copy link
Copy Markdown
Contributor

@fansenze fansenze commented Mar 17, 2026

Summary

Optimize the Windows CI go test strategy. The previous approach ran tests in batches of 15 packages and cleaned the entire build cache (go clean -cache) between batches, forcing recompilation of all shared dependencies (~7.7G) each time. This was very slow.

The new approach:

  1. Pre-build shared dependencies first (go build ./internal/...) to warm the build cache
  2. Run tests in larger batches (50 packages instead of 15)
  3. Between batches, only clean test-generated cache files using timestamp-based filtering, keeping the shared dependency cache warm

Local benchmarks (macOS, 143 packages)

Metric Old approach New approach
Batch size 15 packages 50 packages
Cache cleanup Full go clean -cache Timestamp-based (test artifacts only)
Per-batch time (50 pkgs) ~3m26s (cold cache) ~1m02s (warm cache)
Peak cache ~9.3G ~9.9G
Cache after cleanup 0 (everything wiped) 7.7G (shared deps retained)
Estimated total ~30+ min ~5-6 min

~5-6x faster while keeping peak disk usage under control (~9.9G vs 13G unbatched).

Related Links

N/A

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@fansenze fansenze changed the title chore(ci): remove Windows batch test strategy for go tests chore(ci): optimize Windows go test with warm build cache strategy Mar 17, 2026
Instead of cleaning the entire build cache between batches (which forces
recompilation of all shared dependencies each time), pre-build shared
dependencies first, then only clean test-generated cache files between
batches using timestamp-based filtering. This keeps the ~7.7G shared
dependency cache warm while controlling peak disk usage at ~9.9G.

Local benchmarks show this is ~5-6x faster compared to the previous
cold-cache approach.
@fansenze fansenze force-pushed the chore/remove-windows-batch-test-20260317 branch from 3aa9245 to bf18ebb Compare March 17, 2026 04:25
@fansenze fansenze requested a review from hardfist March 17, 2026 04:36
@fansenze fansenze merged commit 92dd91e into main Mar 17, 2026
14 checks passed
@fansenze fansenze deleted the chore/remove-windows-batch-test-20260317 branch March 17, 2026 05:08
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.

2 participants