Skip to content

Harden React Native iOS Detox CI against simulator shell crashes#29626

Draft
tianleiwu with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-flaky-ios-e2e-tests
Draft

Harden React Native iOS Detox CI against simulator shell crashes#29626
tianleiwu with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-flaky-ios-e2e-tests

Conversation

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

The React Native iOS E2E job is intermittently failing on GitHub-hosted macOS runners due to iOS Simulator instability during Detox teardown/termination. This change makes the workflow more fault-tolerant by isolating build/test phases and resetting simulator state before test execution.

  • Workflow hardening (iOS E2E job only)
    • Split the combined Detox iOS step into two explicit phases:
      • detox build --configuration ios.sim.release
      • detox test ... --configuration ios.sim.release
  • Simulator state reset before test run
    • Added a dedicated cleanup step in react_native_ci_ios_e2e_tests:
      • xcrun simctl shutdown all || true
      • xcrun simctl erase all || true
      • killall Simulator || true
      • killall com.apple.CoreSimulator.CoreSimulatorService || true
  • Detox cleanup on completion
    • Added --cleanup to the Detox test invocation to enforce post-test app/simulator cleanup.
  • Scope
    • Kept changes narrowly scoped to .github/workflows/react_native.yml.
    • Preserved existing JUnit output path and artifact upload behavior.
- name: Run Detox iOS e2e Tests
  run: |
    JEST_JUNIT_OUTPUT_FILE=${{ github.workspace }}/js/react_native/e2e/ios-test-results.xml \
      detox test --record-logs all \
                   --configuration ios.sim.release \
                   --loglevel verbose \
                   --take-screenshots failing \
                   --cleanup

Motivation and Context

The failing job pattern shows simulator process instability (failed to terminate ..., system shell probably crashed) rather than deterministic test logic failures. Resetting simulator state before Detox test execution and enforcing cleanup reduces stale/broken simulator carryover and lowers iOS E2E flake rate in CI.

Copilot AI changed the title [WIP] Fix flaky iOS E2E tests in React Native CI workflow Harden React Native iOS Detox CI against simulator shell crashes Jul 8, 2026
Copilot AI requested a review from tianleiwu July 8, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants