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

kill persistent processes #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

leej3
Copy link

@leej3 leej3 commented May 9, 2024

Description

I am working with a misbehaving test suite that hangs. "retry" has worked very nicely to avoid failures due to this hanging. One issue that I have noticed is that occasionally a pytest session fails to respond to the SIGTERM signal. When this happens two child processes run at the same time and make a bit of a mess. This PR proposes using SIGKILL to make sure the child process exits.

Testing

  • What tests were added?
    • To emulate an unresponsive test session I have added an integration test where the child process ignores interrupts to ensure that it is killed appropriately

@leej3
Copy link
Author

leej3 commented May 9, 2024

It might make sense to kill the whole process group in case there are forked processes. ...ignore, I missed the use of tree-kill...

@leej3
Copy link
Author

leej3 commented May 10, 2024

I've made another attempt at this. My js isn't so good so bear with me!

My understanding is that the test suite is ignoring the SIGTERM, here I propose escalating with a SIGINT, and then using SIGKILL to make sure that the retry of the command does not have the old one hanging around.

Apart from addressing child process that ignore SIGTERM this would also address situations where the clean up is just too slow and a user does not wish to wait longer.

I think my test is now better formulated to timeout at 5 mins so as not to waste CI resources.

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