Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ jobs:
-destination "platform=iOS Simulator,id=${{ steps.ios-simulator.outputs.simulator-udid }}" \
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testSinglePointerFlingFallsBackToXCTestCoordinateDragWhenPrivateSynthesisFails \
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testMissingBundleCommandInvalidatesCompleteCachedTargetState \
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testCachedTargetInvalidationClearsProcessBoundState
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testCachedTargetInvalidationClearsProcessBoundState \
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testSystemModalProbeSliceSharesAndClampsToPlanDeadline \
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testDispatchRecoverySkipsBookkeepingWhileXCTestChannelOccupied \
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testBoundedSystemModalProbeTimeoutRecoversThenReleasesOnDrain \
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testBoundedSystemModalProbeTimeoutRecoversThenReleasesOnDrainForSnapshotRaw

- name: Prepare iOS runner
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,18 @@ extension RunnerTests {
}

private func executeSnapshotDispatched(command: Command) throws -> Response {
try executeDispatchedWithRecovery(command: command) {
try self.executeSnapshotDispatchedOnce(command: command)
}
}

/// The dispatched snapshot recovery loop: read-only retry + XCTest-recorded-failure invalidation,
/// matching what `executeOnMainSafely` gives the generic path. `perform` runs the capture and its
/// own bounded main-thread work.
func executeDispatchedWithRecovery(
command: Command,
perform: () throws -> Response
) throws -> Response {
var hasRetried = false
while true {
let failureCountBefore = try runMainThreadWork(
Expand All @@ -845,7 +857,16 @@ extension RunnerTests {
) {
self.currentXCTestFailureCount()
}
let response = try executeSnapshotDispatchedOnce(command: command)
let response = try perform()
// Recovered independently — re-entering main for bookkeeping would queue behind the still-
// abandoned XCTest query and re-stall the command (#1244), so skip it until that work drains.
if hasAbandonedTreeCapture() {
NSLog(
"AGENT_DEVICE_RUNNER_DISPATCH_RECOVERY_SKIPPED_XCTEST_OCCUPIED command=%@",
command.command.rawValue
)
return response
}
let recordedFailureResponse = try runMainThreadWork(
command: command,
timeout: mainThreadExecutionTimeout,
Expand Down
Loading
Loading