Skip to content

fix(desktop): pin hidden-events superseded write race test - #5215

Merged
tyler-dane merged 10 commits into
mainfrom
cursor/hidden-events-superseded-test-8feb
Nov 11, 2026
Merged

tyler-dane merged 10 commits into
mainfrom
cursor/hidden-events-superseded-test-8feb

Conversation

@tyler-dane

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

Copy link
Copy Markdown
Contributor

What and why

HiddenEventsStoreTests.testSupersededWriteReturnsWithoutApplying flaked on swift-packages because async let does not guarantee which setEventHidden call receives the first write generation on the main actor. When the hide write won the race, expectations flipped (applied vs superseded) even though the store behaved correctly.

This pins the scenario the test name describes: the unhide PUT stays in flight until the superseding hide is queued, matching the generation chain in HiddenEventsStore (post-PUT supersede guard is already on main from #5216).

Verify

  • swift-packages on this PR
  • 50× stress (temporary CI scaffolding, removed before merge): Actions run 42931926667 on head bf9d4bb072760d183a0f43f5819ff6ff829b6fb1, job swift-packages, step Stress HiddenEventsStore superseded test (50x) — log line Stress complete: 50 iterations passed.

Fixes the pre-existing flake seen on PR #5177 (unrelated to wide viewport work).

Open in Web Open in Cursor 

cursoragent and others added 4 commits November 10, 2026 19:06
Hold the in-flight unhide PUT until the superseding hide is queued so the
test matches HiddenEventsStore generation semantics instead of relying on
async let scheduling order.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Re-check write generation after the remote setHiddenEvents call so an
older commit returns superseded instead of applied when a newer hide
was queued during the network round trip.

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
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 10, 2026
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>
cursoragent and others added 2 commits November 10, 2026 23:09
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>
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>
cursoragent and others added 2 commits November 11, 2026 00:08
Keep #5215 pinned supersede test sequencing with gate waitForTest before rehide.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@tyler-dane tyler-dane reopened this Nov 11, 2026
Drop branch-keyed stress steps and the stress shell helper from this PR;
the deterministic test pin stays in HiddenEventsStoreTests only.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@tyler-dane
tyler-dane added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit 5f436ce Nov 11, 2026
32 checks passed
@tyler-dane
tyler-dane deleted the cursor/hidden-events-superseded-test-8feb branch November 11, 2026 01:47
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