Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stabilize stuck cleanup #2721

Merged
merged 2 commits into from Apr 10, 2021
Merged

fix: stabilize stuck cleanup #2721

merged 2 commits into from Apr 10, 2021

Conversation

noomorph
Copy link
Collaborator

@noomorph noomorph commented Apr 9, 2021

Description

  1. Resolves the edge case, when the app does not respond to cleanup action at all, hence it breaks the entire Jest + Detox cleanup phase. Technically, I am adding a 5s graceful period before we reject the pending cleanup request and go further in our detox.cleanup() routine.

  2. client.cleanup() now theoretically cannot throw an error now. That's important if we want to finish properly the outer detox.cleanup().

  3. Also, here I fix an incorrect app PID saving (it is prescribed to run too late, only after the app responds to "isReady"). After the fix, I am able to verify the existing PID (=> app is running) even in cases when the app is not eager to respond it is ready. Not entirely related to this PR (although it was relevant in the first commit with the first implementation, then I changed my mind and we have a no-app-terminate-just-reject-inflightpromise solution), but it is certainly worth fixing.

@noomorph noomorph requested a review from d4vidi April 9, 2021 17:27
detox/src/client/Client.js Outdated Show resolved Hide resolved
detox/src/client/Client.js Outdated Show resolved Hide resolved
detox/src/client/Client.js Outdated Show resolved Hide resolved
detox/src/client/Client.js Outdated Show resolved Hide resolved
@noomorph noomorph merged commit 3e6c0ec into master Apr 10, 2021
@noomorph noomorph deleted the fix/stabilize-stuck-cleanup branch April 10, 2021 09:06
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.

None yet

1 participant