Commit 41ad081
fix(e2e): Retry iOS E2E flows when app fails to reach "E2E Tests Ready" (#6448)
* fix(e2e): Retry iOS E2E flows when app fails to reach "E2E Tests Ready"
On Cirrus Labs Tart VMs, roughly one `maestro test` flow per run of
`e2e-v2.yml` on iOS intermittently fails immediately after
`launchApp clearState` with `Assert that "E2E Tests Ready" is
visible... FAILED`. The failure duration (14-19s) is far below the
5-minute `extendedWaitUntil` in `assertTestReady.yml`, indicating the
Maestro driver or app connection drops on the fresh launch rather than
a real UI regression.
Retry the flow once, but only when the failure output matches this
specific signature — real assertion failures elsewhere (e.g.
`assertEventIdVisible`, `App crashed`) are surfaced immediately so
regressions are not masked. Maestro's CLI exit code is a flat 0/1
(`TestCommand.kt:461`), so the pattern must be detected in stdout.
The retry logs a distinct `[Flaky] ... — retrying (2/2)` line and a
`(attempt 2/2)` suffix on the passing line so CI output makes it
obvious when the flake occurred.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(e2e): Break out of retry loop on non-flake failure
The `else` branch handling a non-retryable failure logged `[Failed]`
but did not exit the inner `for (attempt)` loop, so a real failure
(anything without the `E2E Tests Ready` flake signature) would still
run `maestro test` a second time. That contradicts the "surface
regressions immediately" invariant this retry logic was written to
preserve — if the second attempt happened to pass, a real regression
would be silently masked.
Caught by both Cursor Bugbot and Sentry's autofix reviewer.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent b3d858c commit 41ad081
1 file changed
Lines changed: 55 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
376 | 384 | | |
377 | 385 | | |
378 | 386 | | |
379 | 387 | | |
380 | 388 | | |
381 | 389 | | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
410 | 435 | | |
411 | 436 | | |
| 437 | + | |
| 438 | + | |
412 | 439 | | |
413 | 440 | | |
414 | 441 | | |
| |||
0 commit comments