gh-151496: Use process groups in test_dtrace#151512
Conversation
Create a new process group to run bpftrace commands, so it's possible to kill also child processes on timeout.
|
@stratakis: I addressed your review, thanks. Please review the updated PR. |
Hum. test_socket failed with a strange error. I just re-ran the job. |
|
Nitpick: I'd change the helper name to something other as For testing the assert_usable() path (10s timeout): Fake bpftrace script: And adding it to the $PATH when running the tests: This hangs and also leaves leaked children: For testing the run_case() path (60s timeout): Fake bpftrace script: PATH="fake bpftrace path:$PATH" ./python -m unittest -v test.test_dtrace.BPFTraceNormalTests.test_gc After 60 secs it should failed and children are leaked: With the PR the assert_usable() path doesn't hang anymore and doesn't leak and the run_case() path still times outs but doesn't leak. |
Oh, test_abc of |
Oh thanks for testing manually! It's good that you managed to confirm that my fix works as expected :-)
Calling I prefer to keep "kill" in the function name, since it's the main action of the function. |
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-151589 is a backport of this pull request to the 3.15 branch. |
Create a new process group to run bpftrace commands, so it's possible to kill also child processes on timeout.
test_dtracecan hang indefinitely when bpftrace usability check times out #151496