Repository navigation
Commit a913cb2
authored
fix(ios): keep alert activation out of XCTest's interruption handling (#2843)
* fix(ios): keep alert activation out of XCTest's interruption handling
Before every event XCTest looks for SpringBoard banners and alerts over the target and runs its
interruption handler on them. For a notification banner the default handler waits up to 15 s for
it to leave, so an `alert accept` issued while a banner was visible tapped after the command's
deadline and answered ALERT_DEADLINE_EXCEEDED for a button it had in fact pressed (#2546's late
tap, from the banner side). Four iOS CI failures of the alert replacement tests carry this trace,
including main job 106127169259: banner wait from t=7.98 s, tap at t=15.12 s on a ~15 s deadline.
`withBoundedInteractionIdleTimeoutIfSupported(.preEventSkipped)` drops only the idle wait. Alert
activation now also sets XCUIApplication's `doesNotHandleUIInterruptions` on the alert's owner app
for the one tap. It keeps the XCTest coordinate tap and its post-event settle, which alert
verification relies on; the synthesized-event path would have dropped that settle too.
The runner host app gains a `--agent-device-alert-banner` fixture that keeps a notification banner
over its alert until the alert is answered. The new test fails on the old dispatch with the CI
signature (interruption monitors consulted, ALERT_DEADLINE_EXCEEDED after the button was activated)
and passes with the opt-out.
* test(ios): resolve the alert before the deadline the replacement fixtures assert on
Nine iOS CI failures of the alert replacement fixtures answered ALERT_DEADLINE_EXCEEDED with "No
alert button was activated": the command deadline also covered resolution, about two dozen
accessibility reads before any tap, and a contended hosted simulator spent it all there (job
106268275388 sampled a 0.823 s read, sized a 39.5 s deadline, then spent 39 s resolving). The
latency-sampled deadline from #2708 cannot predict a host that slows down mid-command.
The fixtures now resolve the alert first under a 60 s allowance and hand it to the command through
`alertResolutionOverrideForTesting`, so `timeoutMs` bounds only activation and verification, which
is what they prove: the replacement is never activated. That window gets a fixed 30 s. A confirmed
answer returns as soon as verification sees the replacement; only the unprovable-replacement
fixture pays it in full. The latency sampler and its decomposition test are removed.
The busy-app fixture asserted wall-clock success under a fixed 6 s deadline. It now records whether
the button was answered while its animation was still in flight, and the test asserts that instead.
Reverting the seam to a plain `activateElement` fails it with "Answered after the app went idle".
* test(ios): keep the busy alert fixture busy for the test's whole alert budget
The fixture's fixed 20 s backstop could stop the in-flight animation while a
contended host was still resolving the alert under the 60 s allowance, so a
correct activation read "Answered after the app went idle". The test now
passes the backstop as resolution allowance plus activation deadline.1 parent db4feb9 commit a913cb2
5 files changed
Lines changed: 202 additions & 105 deletions
File tree
- .github/workflows
- apple/runner/AgentDeviceRunner
- AgentDeviceRunnerUITests
- UnitTests
- AgentDeviceRunner
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | 192 | | |
194 | 193 | | |
195 | 194 | | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
71 | 81 | | |
72 | 82 | | |
73 | 83 | | |
74 | 84 | | |
75 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
76 | 88 | | |
77 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
78 | 94 | | |
79 | 95 | | |
80 | 96 | | |
81 | 97 | | |
82 | 98 | | |
83 | | - | |
| 99 | + | |
84 | 100 | | |
85 | 101 | | |
86 | 102 | | |
| |||
101 | 117 | | |
102 | 118 | | |
103 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
104 | 171 | | |
105 | 172 | | |
106 | 173 | | |
| |||
123 | 190 | | |
124 | 191 | | |
125 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
126 | 197 | | |
| 198 | + | |
127 | 199 | | |
128 | 200 | | |
129 | 201 | | |
| |||
145 | 217 | | |
146 | 218 | | |
147 | 219 | | |
148 | | - | |
149 | | - | |
150 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
151 | 230 | | |
152 | 231 | | |
153 | 232 | | |
| |||
185 | 264 | | |
186 | 265 | | |
187 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
188 | 280 | | |
189 | 281 | | |
190 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
117 | 135 | | |
118 | 136 | | |
119 | 137 | | |
| |||
0 commit comments