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.
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 (
firstDismissPopupWindownow uses one predicate query). The same cost remains when a popover is present: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.