Skip to content

fix(ios): cap the iOS 26 Safari WebView hierarchy step so it cannot stall or kill the runner - #4

Merged
jochen-testingbot merged 1 commit into
tb-modsfrom
fix/ios-safari-hierarchy-timeout
Nov 2, 2026
Merged

jochen-testingbot merged 1 commit into
tb-modsfrom
fix/ios-safari-hierarchy-timeout

Conversation

@jochen-testingbot

Copy link
Copy Markdown
Collaborator

The SafariViewService snapshot (iOS 26+) ran on the main actor with no
limit, so a heavy page stalled every hierarchy-based command. Worse, its
webViews.count query records an XCTest failure when the AX request times
out instead of throwing; that fails testHttpServer and the runner exits,
so the session loses its driver.

  • Lower XCTest's per-request AX timeout to 10 s for this step only
    (XCAXClient_iOS _setAXTimeout:error:, exposed via AXClientProxy) and
    restore it afterwards; on timeout return the app hierarchy without the
    Safari part.
  • Replace webViews.count + snapshot with one throwing snapshot that both
    detects the web view and provides the hierarchy, so a timeout surfaces as
    a caught error rather than a recorded test failure.
  • Log how long the step took.

Verified on an iPhone 17 / iOS 26.4 simulator with e2e simple_web_view:
passes with the 10 s cap; with a 1 ms cap the runner survives 16
consecutive timeouts (previously it exited on the first) and the flow
fails only because the web content is omitted.

Rebuilt the simulator driver zips.

…tall or kill the runner

The SafariViewService snapshot (iOS 26+) ran on the main actor with no
limit, so a heavy page stalled every hierarchy-based command. Worse, its
`webViews.count` query records an XCTest failure when the AX request times
out instead of throwing; that fails testHttpServer and the runner exits,
so the session loses its driver.

- Lower XCTest's per-request AX timeout to 10 s for this step only
  (XCAXClient_iOS _setAXTimeout:error:, exposed via AXClientProxy) and
  restore it afterwards; on timeout return the app hierarchy without the
  Safari part.
- Replace `webViews.count` + snapshot with one throwing snapshot that both
  detects the web view and provides the hierarchy, so a timeout surfaces as
  a caught error rather than a recorded test failure.
- Log how long the step took.

Verified on an iPhone 17 / iOS 26.4 simulator with e2e simple_web_view:
passes with the 10 s cap; with a 1 ms cap the runner survives 16
consecutive timeouts (previously it exited on the first) and the flow
fails only because the web content is omitted.

Rebuilt the simulator driver zips.
@jochen-testingbot
jochen-testingbot merged commit 7047955 into tb-mods Nov 2, 2026
17 of 20 checks passed
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