Skip to content

fix(ci): Fix E2E flakiness without retries#5888

Draft
antonis wants to merge 1 commit intomainfrom
fix/e2e-stable-checks
Draft

fix(ci): Fix E2E flakiness without retries#5888
antonis wants to merge 1 commit intomainfrom
fix/e2e-stable-checks

Conversation

@antonis
Copy link
Contributor

@antonis antonis commented Mar 25, 2026

📢 Type of change

  • Bugfix

📜 Description

Alternative to #5830 — fixes E2E test flakiness without per-flow retries.

  • Per-flow process isolation in cli.mjs — each Maestro flow runs in its own process, preventing crash cascade
  • Maestro driver warm-up flow before real tests — first launchApp after simulator boot is unreliable on Tart VMs
  • Simulator boot readinessxcrun simctl bootstatus, Settings.app warm-up, MAESTRO_DRIVER_STARTUP_TIMEOUT bumped to 180s
  • crash.yml runs first — next flow's launchTestAppClear verifies post-crash recovery
  • Sample app test fixes — search all envelopes for app start tx, sort by timestamp, TTID/TTFD allow-list (navigation, ui.load)
  • execSyncexecFileSync to avoid shell interpolation

No test coverage lost. No retries.

#skip-changelog

💡 Motivation and Context

iOS E2E tests fail on Cirrus Labs Tart VM runners due to Maestro driver connection issues on first launch, crash cascade in shared sessions, and envelope delivery order on slow VMs.

💚 How did you test it?

CI

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • All tests passing
  • No breaking changes

🔮 Next steps

Close #5830 if this approach proves stable.

@antonis antonis added the ready-to-merge Triggers the full CI test suite label Mar 25, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2026

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 401.77 ms 451.78 ms 50.01 ms
Size 43.75 MiB 48.08 MiB 4.33 MiB

Previous results on branch: fix/e2e-stable-checks

Startup times

Revision Plain With Sentry Diff
f5fb57c+dirty 405.82 ms 423.92 ms 18.10 ms
9530cff+dirty 399.24 ms 427.22 ms 27.98 ms

App size

Revision Plain With Sentry Diff
f5fb57c+dirty 43.75 MiB 48.08 MiB 4.33 MiB
9530cff+dirty 43.75 MiB 48.08 MiB 4.33 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2026

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1215.25 ms 1216.47 ms 1.22 ms
Size 3.38 MiB 4.73 MiB 1.35 MiB

Previous results on branch: fix/e2e-stable-checks

Startup times

Revision Plain With Sentry Diff
f5fb57c+dirty 1195.00 ms 1190.48 ms -4.52 ms
9530cff+dirty 1230.51 ms 1231.96 ms 1.45 ms

App size

Revision Plain With Sentry Diff
f5fb57c+dirty 3.38 MiB 4.73 MiB 1.35 MiB
9530cff+dirty 3.38 MiB 4.73 MiB 1.35 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2026

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1212.21 ms 1215.86 ms 3.64 ms
Size 3.38 MiB 4.73 MiB 1.35 MiB

Previous results on branch: fix/e2e-stable-checks

Startup times

Revision Plain With Sentry Diff
f5fb57c+dirty 1246.91 ms 1241.61 ms -5.30 ms
9530cff+dirty 1220.98 ms 1216.18 ms -4.80 ms

App size

Revision Plain With Sentry Diff
f5fb57c+dirty 3.38 MiB 4.73 MiB 1.35 MiB
9530cff+dirty 3.38 MiB 4.73 MiB 1.35 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2026

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 396.00 ms 425.62 ms 29.62 ms
Size 43.94 MiB 48.94 MiB 5.00 MiB

Previous results on branch: fix/e2e-stable-checks

Startup times

Revision Plain With Sentry Diff
f5fb57c+dirty 444.45 ms 473.36 ms 28.91 ms
9530cff+dirty 395.80 ms 426.40 ms 30.60 ms

App size

Revision Plain With Sentry Diff
f5fb57c+dirty 43.94 MiB 48.94 MiB 5.00 MiB
9530cff+dirty 43.94 MiB 48.94 MiB 5.00 MiB

@antonis antonis force-pushed the fix/e2e-stable-checks branch from 05eb0bd to 605f13a Compare March 26, 2026 10:07
@antonis antonis changed the title fix(ci): Fix E2E flakiness with stable checks instead of retries fix(ci): Fix E2E flakiness without retries Mar 26, 2026
@antonis antonis force-pushed the fix/e2e-stable-checks branch 2 times, most recently from 0d6c6da to 60075ed Compare March 26, 2026 15:20
Replace retry-based approach (PR #5830) with deterministic fixes:

### Simulator stability (Cirrus Labs Tart VMs)
- `wait_for_boot: true` / `erase_before_boot: false` on simulator-action
- `xcrun simctl bootstatus booted -b` to block until boot completes
- Settings.app warm-up for SpringBoard/system service initialization
- `MAESTRO_DRIVER_STARTUP_TIMEOUT` bumped to 180s

### e2e-v2 test runner (cli.mjs)
- Per-flow process isolation via individual `maestro test` calls
- Maestro driver warm-up flow before real tests (non-fatal)
- crash.yml runs first so the next flow verifies post-crash recovery
- `execSync` → `execFileSync` to avoid shell interpolation
- SENTRY_AUTH_TOKEN redaction in debug logs

### Sample application test fixes
- Search all envelopes for app start transaction (slow VM delivery)
- Sort envelopes by timestamp for deterministic ordering
- Allow-list for TTID/TTFD ops (`navigation`, `ui.load`)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@antonis antonis force-pushed the fix/e2e-stable-checks branch from 8f483e2 to 2ff292c Compare March 27, 2026 13:46
@antonis antonis mentioned this pull request Mar 27, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant