[build-tools] Handle detached Android emulator exits#3998
Conversation
|
⏩ The changelog entry check has been skipped since the "no changelog" label is present. |
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3998 +/- ##
==========================================
- Coverage 59.67% 59.67% -0.00%
==========================================
Files 940 940
Lines 41260 41261 +1
Branches 8666 8666
==========================================
Hits 24617 24617
- Misses 16549 16550 +1
Partials 94 94 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR prevents expected Android emulator process exits (especially those triggered during retry cleanup) from surfacing as unhandled promise rejections by proactively “observing” the detached emulator SpawnPromise immediately after launch.
Changes:
- Attach a non-blocking
asyncResult()observer to the detached emulatorSpawnPromiseright afterunref(). - Add inline comments documenting why the emulator promise is intentionally observed but not awaited at startup.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Observe the detached Android emulator process promise immediately after startup so expected exits during retry cleanup do not surface as unhandled promise rejections.
The emulator is managed through adb after launch. When a startup attempt times out and cleanup kills the emulator, the underlying SpawnPromise can reject while the retry loop is handling the readiness failure. Observing the promise keeps Sentry from capturing that cleanup path as an unhandled SIGKILL while preserving the returned promise for callers that still await it later.
Test plan