Repository navigation
ci: retry failed XCTest cases on the iOS simulator - #882
Merged
Merged
Conversation
Reruns only failed or crashed XCTest cases in a fresh process; Swift Testing failures still fail the job.
2 of 4 tasks
5 tasks done
dustinbyrne
approved these changes
Oct 1, 2026
dustinbyrne
left a comment
Contributor
There was a problem hiding this comment.
worth rolling this back once we root cause this
Contributor
Author
@dustinbyrne I have this debugging right now #883 |
2 of 4 tasks
Contributor
|
i saw that, thanks for doing that! |
2 of 4 tasks
Contributor
Author
@dustinbyrne I think #885 and #886 should fix this finally |
4 tasks done
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.
💡 Motivation and Context
test-ios-simulatorhas been red on most runs since #854 removed-retry-tests-on-failure. That includes 4 of the last 5 runs onmain, plus #861, #872 and #881.The failing tests vary from run to run (
PostHogQueueTest,PostHogSDKTest,PostHogSDKPersonProfilesTest,PostHogAutocaptureIntegrationSpec). They all fail the same way: a stubbed request reachesMockPostHogServerafter the 30s wait, so the test reports "The expected requests never arrived". When a test force-unwraps the result, the empty response crashes it, as inPostHogSDKPersonProfilesTest.swift:188.mainrun (b3b42e28f),PostHogQueueTesttook 84s, with single tests at 21s and 34s. In healthy runs it takes about 3s.add_item_to_queuefailure, the wait expired, and then the queue drained about 13s later.PostHogQueueTestruns (half under heavy CPU load) and a full-suite run showed no stalls.#854 dropped retries because rerunning Swift Testing suites reinstalls irreversible swizzles. This PR adds retries back for XCTest only:
test-without-building -only-testing:, in a fresh process, up to twice. Only the selected cases run, so no Swift Testing suite runs again.xcodebuild-ios.log, so the existing "Report flaky (retried) tests" step lists every test that only passed on retry.This keeps the job usable while the stall itself is investigated. It doesn't fix the stall.
💚 How did you test it?
xcodebuild-ios.logartifacts from 8 recent red runs. It picked the right cases in each, including the crashed one in feat: add disableGeoip config option #872's attempt 4. The two test: isolate deep link event fixtures #881 runs, which also had Swift Testing failures, were correctly not retried.PostHogSDKTestfailures) and feat: add disableGeoip config option #872 (a crash). It reran only those cases on an iOS 26 simulator, they passed, and the script exited 0. A log with Swift Testing failures exited 1 without retrying.-only-testing:PostHogTests/<Class>/<method>:selects exactly one Quick case and runs no Swift Testing suites./bin/bash3.2 and passesshellcheck.📝 Checklist
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Investigated and drafted with Claude Code (Claude Opus 5.5).
gate.wait(), which is in a Swift Testing suite).🤖 Generated with Claude Code