Repository navigation
Stop iOS simulator tests stalling in CI - #917
sambitcreate wants to merge 4 commits into
Conversation
releaseHeldRequest() only completed a request that was already held. A request that arrived after the test's release stayed held with nobody to release it, so a slow simulator turned a 2 s wait into a stall until the URLSession timeout. Release now ends the hold, and each AidenChatTests test starts by resetting the fixture's holds, overrides and open stream.
Two parallel clones on the 3-core, 7 GB hosted runner took 6-9 minutes to boot, stalled whole test processes for minutes, and sometimes never launched, hanging the job until its 50-minute limit. The suite's summed test time is below the clones' wall time. Both iOS jobs now pass -parallel-testing-enabled NO.
There was a problem hiding this comment.
Important
The late-request race fix and the two-lane serial-execution contract need deterministic coverage before merge.
Reviewed changes across the iOS CI workflow, shared chat-test URL protocol fixture, CI policy checks, and CI documentation.
- Serial simulator execution disables parallel unit-test clones in both the blocking Xcode 26 and non-blocking Xcode 27 jobs.
- Late hold release atomically disarms a pending request hold while still completing a request that has already arrived.
- Per-test fixture cleanup rotates the request epoch and resets shared holds, overrides, counters, and streams before each chat test.
- CI policy and documentation record the hosted-runner failure mode and guard the blocking iOS lane's serial flag.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
A fixture test arms a hold, releases it before the request starts, and expects the request to be answered without a second release. It fails on the old releaseHeldRequest() and passes on the fix. The CI policy test now checks -parallel-testing-enabled NO in the ios-27 unit run too.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review, focusing on the deterministic late-request regression coverage and the serial-execution policy for both iOS lanes.
- Covered release-before-arrival deterministically — Added a fixture-level test that releases an armed hold before starting its request, then verifies the request completes without a second release or hold callback.
- Guarded both simulator lanes — Extended the CI policy assertion so removing
-parallel-testing-enabled NOfrom eitheriosorios-27fails the policy test.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

The blocking iOS build and simulator tests job has been failing or hanging on
mainand on PRs that touch no iOS code. This PR fixes the two causes found. It changes the CI harness and one test fixture. No product code changes.What failed
Each run failed a different test. In every case that test had stalled for minutes, though it takes well under a second locally:
mainb2b5c35, 45266448643AidenChatTests.testUploadCleanupRevocationDoesNotDeadlockRemovalIDERunOperation), no result bundleAidenSandboxedHTMLTests.testAPreviewPageMakesNoNetworkConnectionscom.apple.instruments.deviceservice.lockdownAidenNativeIntegrationTests.testReconcileEndsAnActivityFromAnOlderPairinglaptopreadofflineAlso reported tonight with the same shape:
AidenBrowserRecordingOwnershipTests.testPresentedPlayerSurvivesUntilDismissalThenDeletesOnlyItsFile(5 s wait for the player) andAidenChatTests.testPreparationSurvivesTheChatComposerGivingWayToAQuestionCardfollowed by the sameIDERunOperationcrash.Root cause 1: parallel simulator clones on the hosted runner
The XCTest step ran with the scheme's
parallelizable = YES, so xcodebuild booted two clones of the simulator on the 3-core, 7 GBmacos-26runner.IDERunOperationcrash onmainwas thrown in xcodebuild'sXCTHTestOperationCoordinatorwhile it handled Clone 1's report for the stalled test, 9 s after that test ended. That is the clone coordination path; I can't prove it never happens serially, but no serial run has hit it.Fix: both iOS jobs' XCTest step now pass
-parallel-testing-enabled NOand run on one simulator. The scheme keepsparallelizable = YESfor local Xcode.scripts/check-ci-policy.test.mjsasserts the flag, with the reason.Root cause 2: a held fixture request could outlive the test's release
AidenChatProgressLifecycleURLProtocolis the static URL protocolAidenChatTestsshare.holdNextRequest(endingIn:)arms a hold, andreleaseHeldRequest()completed only a request that was already held. If the request arrived after the test's release, as a late DELETE does on a stalled host, it was still held, and nothing would release it.testUploadCleanupRevocationDoesNotDeadlockRemovalthen waits oncompletion.valueuntil the URLSession request timeout, and longer if cleanup retries. A slow DELETE should fail the 2 sdeleteArrivedwait. Instead it stalled the test for 228 to 596 s, which is how this test pushed #904 past the job limit.Fix:
releaseHeldRequest()now ends the hold. It completes a request that is already held, and clears the armed path and callback, so a request that arrives later goes through.AidenChatTests.setUpcallsreset()afterbeginTestEpoch(), so no test inherits an armed hold, response override or open event stream from a test that ended early. Requests from earlier tests were already cut off by the epoch header.The #904 fixer found that this test passed 15 of 15 times alone, even with every core pegged, and failed only partway through a CI suite. That fits: alone, the DELETE always arrives inside the 2 s window.
Local verification
Xcode 27.1 (
/Applications/Xcode.app), a dedicated iPhone 17 Pro iOS 26.5 simulator, the same scheme and flags asci.yml:main's tree, before these changes: 2,569 passed, 0 failed, 8 skipped, in 273 s of test time. The host's load average was about 130 from other work. The test host reached about 1.6 GB.releaseHeldRequest(), the test took 61.9 s and failed three ways: the forced wait,finishedafter 3 s, andneedsPairing. The test only got pastawait completion.valuewhen the URLSession request timeout fired. With the fix, it took 1.9 s and failed only the forced wait.-parallel-testing-enabled NO: 2,569 passed, 0 failed, 8 skipped both times. Test time was 226 s and 204 s. After the second run passed, xcodebuild spent about 4.5 minutes in its ownsimctl diagnosecollection. I stopped that by hand. It came after the tests finished, so no test was involved.yes(load average 81): all 30 passed. The tests were the revocation and purge upload-cleanup tests, the question-card preparation test, the recording-player test,testReconcileEndsAnActivityFromAnOlderPairingandtestAPreviewPageMakesNoNetworkConnections.testAReleasedHoldLetsALateRequestThrough(added for Pullfrog's finding): it fails 2 of 2 on the oldreleaseHeldRequest(), where the request stays parked past its 5 s wait. It passes 8 of 8 on the fix, in about 0.11 s each.node --test scripts/check-ci-policy.test.mjspasses 19 of 19. If the flag is removed fromios-27alone, it fails with anios-27:message.Known unrelated failure
Desktop tests (renderer-other)failed on 814a19d (job 138494591179). The only failure waspackages/cli/tests/server-visuals.test.mjs:172, "an installed browser draws a chart offline into a picture and leaves no profile behind", after 15.3 s. That is the known Chrome cold-start timeout. #914 fixes it onmain, and this PR does not touch it.PRs this unblocks
#890, #900, #901, #904 and #915. None of them changes iOS code. Their iOS job should pass after a merge of
main, or a rerun once this lands.Docs
docs/ci.mddescribes the iOS job as running on one simulator, and has a dated flake entry for 2026-11-24.