Skip to content

test: relaunch an Android test app that never initialised once - #2901

Draft
bitsandfoxes wants to merge 1 commit into
ci/license-retry-jitterfrom
ci/android-launch-recovery
Draft

bitsandfoxes wants to merge 1 commit into
ci/license-retry-jitterfrom
ci/android-launch-recovery

Conversation

@bitsandfoxes

@bitsandfoxes bitsandfoxes commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The Android integration tests now relaunch the app once when a launch hangs before the Unity engine starts, instead of failing every context after it.

Every so often, an Android launch hangs: the process is up, but the Unity engine never logs a line (sometimes not even past JNI_OnLoad). It waits out app-runner's 300 s run timeout, and so far the process stayed alive afterwards, so every later am start -W brought the hung app back to the front (same PID) instead of starting it again. That turned one hang into 3–4 red contexts. In the last 30 days, 7 Run Android jobs failed this way, 6 of them with 3 or more failed contexts (e.g. 118708786184: App PID: 4056 for all five launches, 0/81 passed, 25 of the step's 30 minutes spent waiting). It hit the emulator legs; Redroid goes through the same AdbProvider path. In all 7 jobs, none of the hung launches logged a Unity line, and every launch that did initialise logged one.

How it works now:

  • app-runner force-stops the app before each launch and after a run timeout (fix(adb): Force-stop the app before each launch and after a run timeout app-runner#64, pinned here), so a relaunch gets a fresh process.
  • Invoke-TestAction runs each launch, including crash-send, through Invoke-App. On Android, when the output has neither an EVENT_CAPTURED: nor a Unity log line, it prints that launch's output in a collapsed group, warns with ::warning::Android app never initialised, relaunching (1/1) and launches once more.
  • One relaunch per run. After a second launch that never initialised, the remaining contexts fail right away instead of launching: each hung launch costs the full 300 s, and six of them would run into the step's 30-min timeout rather than report the failure. A real init deadlock therefore still fails, after ~10 min instead of ~25.

Stacked on #2900. The app-runner pin from #2899 moves to the commit with the force-stop.

CI evidence: run 40185846696, with a throwaway commit (since dropped) that made the first launch wait for a debugger, so it never initialised. In all 4 Run Android jobs, the first launch (Message Capture) waited out the timeout, then logged ::warning::Android app never initialised, relaunching (1/1). The relaunch came up under a new PID (e.g. 121151142372: 4326 → 6421) and each job passed 77/77 (4 skipped).

Rebased onto #2907: run 40272431963 is green on the first attempt.

🤖 Generated with Claude Code

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.

1 participant