Repository navigation
test(mac): control answer order in the coalescing-fetch invalidation test - #143
Merged
Merged
Conversation
…test The test assumed the two requests answer in the order they start. On a stalled runner the second answered first (CI run 41663143761), so the early caller correctly took the newer answer and the assertion failed. A gated stand-in now fixes the order, and a second test covers answers arriving out of order; every original assertion is kept. Co-Authored-By: Claude <noreply@anthropic.com>
raiseCatError
marked this pull request as ready for review
November 3, 2026 17:00
This was referenced Nov 3, 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.
CoalescingFetchTests.testAnInvalidationDuringARequestWaitsForTheNextOnefailed on #141's Mac job (run 41663143761):XCTAssertEqual failed: ("2") is not equal to ("1")at line 61. #141 only edits a workflow, so the failure is unrelated to it.Root cause: an ordering assumption in the test, not an app bug
CoalescingFetchthen correctly served both waiters from request 2, a request started after the invalidation, sofirst == 2. The late caller still got 2, and only 2 requests were sent.first=2 late=2 calls=2. A gated service that releases request 2 first gives the same result every time.testNoMoreThanTwoRequestsAreOut,testStartedAfterNowGetsANewRequestSharedByLateCallers).Change (test only)
GatedServicestand-in answers each request only when the test releases it, so the order is fixed by the test, not by the scheduler. Its only waits are condition polls ("request n is out"), not timing assumptions.…WhenAnswersArriveOutOfOrder: request 2 answers first. Both callers get 2, the late caller never gets the stale answer, and 2 requests are sent.Checked locally (Xcode builds blocked by low internal disk; the real test file was compiled with
swiftcagainst XCTest):CoalescingFetchTestspass.The
macjob here is the first full Xcode run of the change.🤖 Generated with Claude Code