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

Try to exit gracefully on SIGINT #1378

Closed
inikulin opened this issue Apr 5, 2017 · 9 comments
Closed

Try to exit gracefully on SIGINT #1378

inikulin opened this issue Apr 5, 2017 · 9 comments
Assignees
Labels
AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: CLI A command-line interface issue. SYSTEM: runner TYPE: enhancement The accepted proposal for future implementation.
Milestone

Comments

@inikulin
Copy link
Contributor

inikulin commented Apr 5, 2017

Are you requesting a feature or reporting a bug?

feature

What is the current behavior?

TestCafe terminates leaving browsers open

What is the expected behavior?

Try to terminate running tasks gracefully and only after some timeout terminate process if
it didn't work

@inikulin inikulin added AREA: server SYSTEM: CLI A command-line interface issue. SYSTEM: runner TYPE: enhancement The accepted proposal for future implementation. labels Apr 5, 2017
@inikulin inikulin added this to the Sprint #6 milestone Apr 5, 2017
@inikulin inikulin self-assigned this Apr 5, 2017
@inikulin inikulin modified the milestones: Planned, Sprint #6 Apr 12, 2017
@inikulin
Copy link
Contributor Author

Proposed strategy:

  1. Try to call task.abort() in CLI on SIGTERM and SIGINT
  2. After some considerably big timeout forcefully terminate the process.
  3. If SIGTERM or SIGINT was raised second time then forcefully terminate the process.

\cc @AndreyBelym

@AlexanderMoskovkin AlexanderMoskovkin modified the milestones: Sprint #7, Planned Apr 25, 2017
@AlexanderMoskovkin AlexanderMoskovkin modified the milestones: Sprint #7, Planned May 26, 2017
@AlexanderMoskovkin AlexanderMoskovkin modified the milestones: Sprint #8, Planned Jun 13, 2017
AndreyBelym added a commit to AndreyBelym/testcafe that referenced this issue Jun 28, 2017
AlexanderMoskovkin pushed a commit to AndreyBelym/testcafe that referenced this issue Jul 20, 2017
…s#1576)

* Handle SIGINT via async-exit-hook (closes DevExpress#1378)

* Use updated package

* Fix typo

* Add message
@AlexanderMoskovkin
Copy link
Contributor

I reopen this since it works when you run build and run testcafe from sources, but doesn't work when you run globally installed testcafe.

@miherlosev
Copy link
Collaborator

It is not working on [email protected]@alpha-5.
https://www.screencast.com/t/ob1S43IJ

@inikulin
Copy link
Contributor Author

@AlexanderMoskovkin It's because we spawn another process in CLI and this parent process receives SIGINT, not the actula testcafe. We need just to pass it to the child process.

@inikulin
Copy link
Contributor Author

@inikulin
Copy link
Contributor Author

Oh, seems like the problem is that in v8-flag-filter we send SIGTERM immediately after SIGINT. It expects program to terminate synchronously. @AlexanderMoskovkin I'll add you as a co-maintainer to module on github and npm, so you will be able to fix it.

@AlexanderMoskovkin AlexanderMoskovkin removed this from the Sprint #8 milestone Jul 31, 2017
@AndreyBelym
Copy link
Contributor

It happens because process.kill doesn't work properly on Windows, it just silently terminate the child process: nodejs/node#12378. PM2 (popular process manager for Node.js https://www.npmjs.com/package/pm2) uses special shutdown message on Windows: http://pm2.keymetrics.io/docs/usage/signals-clean-restart/#windows-graceful-stop. IMHO we can use it in our case.

@AlexanderMoskovkin
Copy link
Contributor

[email protected] is released

AndreyBelym added a commit to AndreyBelym/testcafe that referenced this issue Sep 11, 2017
AndreyBelym added a commit to AndreyBelym/testcafe that referenced this issue Sep 11, 2017
AndreyBelym added a commit to AndreyBelym/testcafe that referenced this issue Sep 19, 2017
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
…s#1576)

* Handle SIGINT via async-exit-hook (closes DevExpress#1378)

* Use updated package

* Fix typo

* Add message
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: CLI A command-line interface issue. SYSTEM: runner TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests

4 participants