Skip to content

Reproduce Swift collector loss after an XCUITest runner restart - #65

Open
pda wants to merge 1 commit into
mainfrom
reproduce-swift-xcuitest-runner-loss
Open

Reproduce Swift collector loss after an XCUITest runner restart#65
pda wants to merge 1 commit into
mainfrom
reproduce-swift-xcuitest-runner-loss

Conversation

@pda

@pda pda commented Aug 25, 2026

Copy link
Copy Markdown
Member

Why

test-collector-swift buffers completed tests in the XCTest runner and flushes only when the bundle finishes. If Xcode replaces that process mid-suite, completed executions disappear even though .xcresult remains complete.

This PR is intentionally stacked on #64 so the normal green XCUITest integration can be reviewed and merged separately.

What

  • finish two tests, then terminate the UI test runner once using a marker persisted by the target app
  • let Xcode continue the suite in a replacement runner with retry support enabled
  • retain an intentional post-restart failure with an execution tag, source location, and expanded backtrace
  • compare the five unique tests in .xcresult with unique test names in the collector's upload log
  • soft-fail the pipeline step while this regression is present

Observed result

On Xcode 26.5, .xcresult retained all 5 tests while the collector recorded only the 2 tests completed by the replacement runner. The surviving failure retained its native location, expanded backtrace, and execution tag. The verifier fails on the 5-vs-2 mismatch as intended.

Rollback

Revert this PR to return #64's green XCUITest example; no persistent data or migrations are involved.

Related

Base automatically changed from add-swift-xcuitest-example to main August 25, 2026 06:24
Extend the green XCUITest fixture with a crash-once marker persisted by
the target app. Two tests finish before the UI test runner kills itself;
Xcode then replaces the runner and continues the remaining tests.

Capture collector debug output and compare its unique uploaded test names
with the completed xcresult. The local reproduction retains all five tests
in xcresult but records only the two tests run after replacement. Keep an
intentional post-restart assertion failure to prove execution tags, source
location, and expanded backtrace remain available on delivered traces.

The pipeline step is soft-failed because this branch is intentionally a
failing regression fixture until the collector gains durable delivery.

Amp-Thread-ID: https://ampcode.com/threads/T-01a036f0-4e44-73ab-a085-68af2e00b5cb
Co-authored-by: Amp <amp@ampcode.com>
@pda
pda force-pushed the reproduce-swift-xcuitest-runner-loss branch from df12e25 to 92b7a64 Compare August 25, 2026 07:20
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.

1 participant