Skip to content

iOS alert resolution reads every element of the app window when a popover is found #2905

Description

@thymikee

Problem

Alert handling in the iOS runner reads per element over a whole app window, with no deadline check, when a popover is found. #2901 fixed the no-alert case (firstDismissPopupWindow now uses one predicate query). The same cost remains when a popover is present:

  • the resolution root becomes the whole app window (RunnerTests+Alert.swift ~47-48);
  • actionableElements (RunnerTests+SystemModal.swift ~121-143) makes about 5 XCTest reads for each button, cell and link;
  • preferredAlertTitle (RunnerTests+Alert.swift ~219) walks every descendant.

A popover over a list with many rows can therefore overrun the command watchdog and keep the runner busy. The synchronous XCTest work continues after the watchdog answers the client, so later commands get RUNNER_BUSY. This is the same wedge #2901 fixed for the no-alert path.

Required behavior

Alert resolution makes a bounded number of XCTest reads, whatever the screen size: query under the dimming or popover region, use predicates instead of walks, and check the command deadline between reads. Add a regression fixture with a popover over a long list, and assert the command finishes well within its budget.

Found in the adversarial review of #2901.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions