Skip to content

[CHORE] Fix integration test runner timeout & isolate inner DerivedData#261

Merged
ypopovych merged 2 commits into
mainfrom
chore/fix-intergation-tests-flakiness
May 26, 2026
Merged

[CHORE] Fix integration test runner timeout & isolate inner DerivedData#261
ypopovych merged 2 commits into
mainfrom
chore/fix-intergation-tests-flakiness

Conversation

@ypopovych

@ypopovych ypopovych commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Defer the inner xcodebuild build-for-testing out of Swift Testing's prepare(for:) and into provideScope(for:performing:). xcodebuild gates the xctest "ready to run" handshake on trait preparation finishing within a multi-minute cap; the inner build is well over that on cold checkouts and trips "The test runner timed out while preparing to run tests" (confirmed via xcresult on a failing visionOS run). Simulator boot stays in prepare(for:) because it's cheap.
  • Inner xcodebuild invocations now use an isolated -derivedDataPath $SRCROOT/build/integration-DerivedData so the inner SWBBuildService can't evict the outer test bundle's cached build descriptions mid-run. This matches the duplicate-blueprint warnings and mid-build aborts seen in the original CI logs.
  • On failure(), the workflow now zips and uploads every *.xcresult from both DerivedData roots as a separate artifact, so future failures don't truncate the way the original logs did.

Test plan

  • Re-run Integration Tests workflow on this branch via workflow_dispatch across the full matrix (Xcode 26.2 / 26.4 × macOS / iOSsim / tvOSsim / watchOSsim / visionOSsim).
  • Confirm no job hits "test runner timed out while preparing to run tests".
  • If a job does fail, verify the new *-integration-xcresult artifact is attached and openable with xcrun xcresulttool.

🤖 Generated with Claude Code

ypopovych and others added 2 commits May 26, 2026 14:50
When `xcodebuild test` exits non-zero the existing logs truncate right
where the failure footer lands, so we can't see which Swift Testing
expectation/run actually failed. Upload the xcresults from DerivedData
on failure (zipped to keep the artifact upload fast) so we have the
real test events next time the matrix goes red.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The xcresult from the failing visionOS job had it: "The test runner
timed out while preparing to run tests." xcodebuild gates the xctest
runner's "ready to run" handshake on Swift Testing trait `prepare(for:)`
finishing, with a multi-minute cap. `BuildProvider.prepare(for:)` was
calling `XcodeTestRunner.build()` — `xcrun simctl boot` plus
`xcodebuild build-for-testing` — which can run several minutes on a
cold checkout, blowing the cap.

Keep simulator boot in `prepare(for:)` (cheap) and move the module
build into `provideScope(for:performing:)`, which runs after the
preparation handshake completes and is governed by the per-test
execution allowance instead. Inner xcodebuilds also get an isolated
`-derivedDataPath` so their SWBBuildService can't evict cached build
descriptions out from under the outer test process — that contention
matched the duplicate-blueprint warnings and mid-build aborts seen in
the original logs.

Also collect xcresults from the new isolated DerivedData in the
on-failure artifact upload.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@ypopovych
ypopovych requested review from a team as code owners May 26, 2026 15:09
@datadog-official

This comment has been minimized.

@ypopovych
ypopovych merged commit 5d2dcc7 into main May 26, 2026
40 of 41 checks passed
@ypopovych
ypopovych deleted the chore/fix-intergation-tests-flakiness branch May 26, 2026 20:11
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