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

Detox catches SIGINT and SIGTERM, causing long running subprocesses to never end #881

Closed
rotemmiz opened this issue Aug 12, 2018 · 7 comments

Comments

@rotemmiz
Copy link
Member

Detox catches SIGINT and SIGTERM to be able to cleanup artifacts currently being recorded on Android emualtors (and probably more things) before termination
https://github.com/wix/detox/blob/master/detox/src/utils/onTerminate.js#L4

Not sure if this is an issue with node, but currently, when a user tries to terminate the test (ctrl+c), any long running subprocess/server will continue running and will need to be forcefully killed. Node will not inform/kill those subprocesses/servers.

I think we should drop onTerminate event altogether, and keep things dirty if a user stops, and act exactly like test runners expect tests to run. This is not ideal, but will keep us out of trouble.

Instead of cleaning up upon onTerminate, we may cleanup the emulator from half baked artifacts during deviceDriver.acquireFreeDevice.

@LeoNatan
Copy link
Contributor

This is not good and should be handled quickly.

@noomorph
Copy link
Collaborator

Sure.

@LeoNatan
Copy link
Contributor

Hi guys,

Can this issue be closed now that merge? @rotemmiz @noomorph

@noomorph
Copy link
Collaborator

Yes and no. But let's close. There is another problem to solve (cleaning artifacts junk that you get if you Ctrl+C the runner), however.

@LeoNatan
Copy link
Contributor

Why is there only one catch for signals? Can't we catch and then "rethrow"?

@noomorph
Copy link
Collaborator

I have not found a way in Node.js so far :/

@LeoNatan
Copy link
Contributor

Node🤦‍♂️

@lock lock bot locked as resolved and limited conversation to collaborators Aug 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants