-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
SIGINT trap consistent with TERM behaviour #1353
Conversation
I'll pull this down and give it a quick play. EDIT: Could you maybe write a changelog entry for this, as it's definitely new behaviour |
So I couldn't get the new behaviour (Adding your one line didn't affect things for me), Possibly due to me not often using
Running without your code yielded the following
2 (Ctrl+C)
This suggests to me that without your code, Ctrl+C does still run the global teardown hooks. If I've got something wrong, please let me know. I've also tried with your code and didn't notice any difference. |
Forgot to write I have used this project as test: First of all the intention of the change is when hitting In my project I notice that In the past one hits I think if you use my project with wait times of 100 seconds, it will be more apparent. Please let me know what you think, I can add release notes. But I would appreciate to tell me what text will be desired more than Thank you for looking into this! |
Hi There, Yes you are right, my example was bad. I've tried a new one with a slow scenario (Not before/after), and it works exactly as you described. Can you just add something into the Changelog, explaining the before/after. Pretty much as you just have here. I'll get this merged in once that's done. Cc/ @tooky I've tested this locally and it works exactly as he has described. This is a good bugfix. (Beforehand it was actually broken) |
Done, let me know if wording is good. |
@@ -26,6 +26,10 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo | |||
([#1329](https://github.com/cucumber/cucumber-ruby/pull/1329) | |||
[deivid-rodriguez](https://github.com/deivid-rodriguez)) | |||
|
|||
* Make SIGINT/`Ctrl+c` behavior consistent with SIGTERM/`kill` behavior - now first invocation causes existing scenario to stop running and jump to `at_exit`, second invocation causes immediate exit. Before that first invocation only instructed Cucumber to exit after scenario and second invocation caused immediate exit skipping `at_exit`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny formatting detail: if you remove the newline at line 28, the bullet list becomes 1 bullet list, making formatting nicer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just git commit amend this @akostadinov and I'll approve and merge this in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't notice that! fixed now
Hi @akostadinov, Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾 In return for this generous offer we hope you will:
On behalf of the Cucumber core team, |
Merged. Thanks for your contribution |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
fixes #988
Details
Basically now first
Ctrl+C
will terminate scenario execution but will stil executeat_exit
hooks. SecondCtrl+C
will also interrupt that.Motivation and Context
see #988
In the past first
Ctrl+C
only told Cucumber to exit after this scenario. And a second one terminated immediately withoutat_exit
hooks. So there was no way to interrupt immediately but still executeat_exit
. This could lead to tested system to remain in inconsistent state and require manual restore.How Has This Been Tested?
Not sure how can I test this.
I editted my local copy of the gem and run a test scenario
Screenshots (if appropriate):
Types of changes
Not sure about the above.
Checklist: