Repository navigation
Conversation
…a shutdown sees its emulator exit
The timeout branch of #waitForExit armed a second timer that was never cancelled, so a stopped daemon stayed alive until it fired (up to readinessTimeoutMs, 180 s by default). Keep one timer and cancel it after the race.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #237
After
daemon stop, the daemon process stayed alive for up to 180 s. The Android driver's#waitForExitarmed a second timer inside thePromise.racetimeout branch and never cancelled it, so when the emulator exited first that timer kept the event loop alive untilreadinessTimeoutMsran out.#waitForExitnow arms one timer, keeps its handle, and cancels it in afinallyafter the race. This covers both the normal exit and await()that rejects.timerFiredis gone. On timeout it still returnsfalse, so the SIGKILL path still runs.Other places that race against a clock timer in
src/drivers/android/andsrc/drivers/ios/were checked. The iOSxcrunrunner already cancels its timer in afinally. The two#delayhelpers are plain awaited sleeps, not races. Neither needed a change.Checklist
src/drivers/android/index.test.ts. This is the triage test, and it now passes.true.finally.pnpm checkpasses.Review
Spec review: 0 findings. Code review: 2 findings, 2 fixed (second round: 0 findings).
Written by an agent.