How To Kill Sub Process In Anytime While Closing It In Orderly Fashion
I have a GUI that run multiple tests files. All the tests are python files that the GUI run one by one using subprocess running from thread. In the GUI , the user has the ability t
Solution 1:
You should be able to use something like this solution to identify and terminate the subprocesses launched by the application to run tests. This solution seems to particularly fit your use case of killing all background processes in order to allow your application to run more tests.
Alternatively, you may be able to create a try-except
wrapper or decorator for your tests that allow them to be killed when sent a certain signal is sent by the application, but this requires the application to keep track of all initiated subprocesses and may fail to properly kill all processes if the tests launch additional subprocesses in the background.
Post a Comment for "How To Kill Sub Process In Anytime While Closing It In Orderly Fashion"