Skip to content

test(e2e): surface stalled spec and capture BrowserStack diagnostics - #236

Merged
gmaclennan merged 1 commit into
mainfrom
test/e2e-stall-diagnosability
Aug 18, 2026
Merged

test(e2e): surface stalled spec and capture BrowserStack diagnostics#236
gmaclennan merged 1 commit into
mainfrom
test/e2e-stall-diagnosability

Conversation

@gmaclennan

Copy link
Copy Markdown
Member

When the in-app suite stalls (issue #233), CI currently yields nothing: Maestro's extendedWaitUntil on all-tests-done expires before the screenshot step, the job log carries no spec output, and the device logs BrowserStack records are never fetched. Every occurrence costs a re-run and yields no diagnosis. This PR makes a stall name its spec through three layers.

In the e2e app, the currently-running spec is always rendered (current-spec testID) so any screenshot names it, the progress counter gets a test-progress testID, and jasmineEnv.execute() races a 240-second watchdog — inside Maestro's 300-second window — that on expiry renders all-tests-done plus a "Suite timed out during: " failure, so a stalled run still reaches Maestro's screenshot step and fails on all-tests-passed with evidence. The NoopGlobalErrors stub, which silently swallowed errors outside specs (a plausible cause of the hang), is replaced with a real implementation over React Native's ErrorUtils and Hermes' promise-rejection tracker: uncaught errors and unhandled rejections are logged, routed into jasmine as failures, and listed in the UI.

In the run-browserstack-maestro action, the final failed attempt now downloads each failed session's device logs and screenshots (field names verified against a real past build's session JSON), prints the app-tagged device-log lines into the job log — on Android that includes the [e2e] spec started lines, which answers "which spec" directly — and uploads everything as a browserstack-diagnostics-<platform> artifact. Collection is best-effort and the upload step runs only after the run step has already failed, so diagnostics can never mask the real failure or change the action's exit code or retry classification.

The failure path can only be exercised by a real BrowserStack run; the collection script was validated GET-only against a past build's artifacts, and this PR's own labeled e2e run tests the happy path end to end.

Closes #233

The in-app jasmine suite intermittently never renders all-tests-done, and a
stalled run left nothing to diagnose: no spec name in CI output, no device
logs, no screenshot (Maestro's extendedWaitUntil dies before the screenshot
step).

In the e2e app, always render the currently-running spec (testID
current-spec), give the progress counter a testID (test-progress), and wrap
jasmineEnv.execute() in a 240s watchdog — inside Maestro's 300s window — that
renders all-tests-done plus a 'Suite timed out during: <spec>' failure, so a
stall reaches the screenshot step and names the culprit. Replace the
NoopGlobalErrors stub with a real implementation over ErrorUtils and Hermes'
rejection tracker (neither is wired up in Release), so uncaught errors and
unhandled rejections are console.error'd, routed to jasmine, and surfaced in
the UI instead of silently hanging the suite.

In the run-browserstack-maestro action, on the final failed attempt download
each failed session's device logs and screenshots (URLs verified against a
real past build's session JSON), print the app-tagged device-log lines into
the job log, and upload everything as a browserstack-diagnostics-<platform>
artifact. Collection is best-effort and the upload step runs only after the
run step has already failed, so diagnostics can never mask the real failure
or change the action's exit semantics.
@gmaclennan gmaclennan added the run-e2e Run the full BrowserStack e2e on this PR (otherwise it runs only in the merge queue) label Aug 18, 2026
@github-actions github-actions Bot added the maintenance Refactor / test / chore / ci / build (changelog) label Aug 18, 2026
@gmaclennan
gmaclennan added this pull request to the merge queue Aug 18, 2026
Merged via the queue into main with commit 3b3b9f9 Aug 18, 2026
33 of 42 checks passed
@gmaclennan
gmaclennan deleted the test/e2e-stall-diagnosability branch August 18, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Refactor / test / chore / ci / build (changelog) run-e2e Run the full BrowserStack e2e on this PR (otherwise it runs only in the merge queue)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e: in-app suite intermittently never reaches all-tests-done (Pixel 9 / Android 16)

1 participant