Skip to content

fix(ci): keep swift-packages under timeout with warm SPM cache - #5216

Merged
tyler-dane merged 2 commits into
mainfrom
cursor/swift-packages-ci-perf-4d92
Nov 11, 2026
Merged

tyler-dane merged 2 commits into
mainfrom
cursor/swift-packages-ci-perf-4d92

Conversation

@tyler-dane

@tyler-dane tyler-dane commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #5215 (merge-queue swift-packages cancellation)

Root cause

  1. Hang (merge queue 42900886638): XCTest blocked ~18 minutes because EventsStorePendingPresentationColorTests called apiGate.resume() before the mock replace handler reached apiGate.wait() (resume() no-ops with no waiter). Buffered XCTest output stopped after DemoDataSeederTests, masking the real stuck test.
  2. Slow path (cold cache): swift-packages had a cache miss and recompiled CompassData (~92s) even though macos-build had just compiled the same tree via Xcode/DerivedData.

Fix

  • Warm and save shared swift-pkgs-v1 .build artifacts from macos-build (parallel to xcodebuild on miss); swift-packages runs swift test --skip-build on cache hit.
  • Gate coordination: AsyncTestSignal before resume, teardown gate resumes, explicit Task { @MainActor in ... } for EventsStore mutations, HiddenEvents post-PUT supersede + bounded gate waits.
  • Live timing lines in test-macos-swift-packages.sh (NSUnbufferedIO=YES).

Job timing evidence

Run Event swift-packages wall Test step Build/compile Outcome
42900886638 / 130127466148 merge_group #5215 20m19s (timeout) ~20m hung after DemoDataSeeder cache miss, 92s build cancelled
42900975928 / 130163786760 PR #5177 5m48s 3m11s cache hit, 48.6s + 50.5s builds (serial) success
42915039175 / 130181127236 PR #5216 (attempt 1) 20m14s stuck on testReplaceInvokesCacheRefreshBeforeAPIReturns cache hit, skip-build cancelled (parallel + gate race)
42920978512 / 130199010124 PR #5216 (attempt 2) 2m57s (23:24:47–23:27:44) ~2m with skip-build cache hit success

macos-build on the green run: 6m25s (23:10:29–23:16:54), including parallel SPM warm on miss.

Verify

bun test packages/scripts/src/testing/macos-ci-contract.test.ts — 5 pass.

macOS workflow run 42920978512: swift-packages success (head 27fb68c88).

VERDICT: INCOMPLETE (Linux agent; macOS gates exercised on GitHub).

Open in Web Open in Cursor 

cursoragent and others added 2 commits November 10, 2026 22:29
Parallelize CompassData and CompassUI swift test, skip rebuild when
.build artifacts are restored, and prebuild packages beside xcodebuild so
merge-group swift-packages avoids cold compiles. Hidden event coordination
tests use explicit tasks, bounded gate waits, and post-PUT supersede checks
so xctest cannot hang until the job timeout.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Wait for the mock replace handler to reach its gate before calling
resume so an early resume cannot noop and leave xctest blocked until
the job timeout. Run package tests serially again and add teardown
resumes on coordination gates.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@tyler-dane
tyler-dane added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit cf0edff Nov 11, 2026
36 checks passed
@tyler-dane
tyler-dane deleted the cursor/swift-packages-ci-perf-4d92 branch November 11, 2026 00:08
cursor Bot pushed a commit that referenced this pull request Nov 11, 2026
Resolve HiddenEventsStoreTests by keeping #5215's gated supersede pin
with #5216's Task, waitForTest, and defer gate resume patterns.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Nov 11, 2026
Keep #5215 pinned supersede test sequencing with gate waitForTest before rehide.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Nov 11, 2026
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Nov 11, 2026
Merge current main (#5216 swift-packages cache). Restore main
HiddenEventsStore tests, remove stress workflow/script, default wide
viewport repeat to 1, keep wide Intel job on test-macos.yml.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
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