pytest
pytest copied to clipboard
Multiprocessing Issue
- [x] a detailed description of the bug or problem you are having
- [x] output of
pip listfrom the virtual environment you are using - [x] pytest and operating system versions
- [x] minimal example if possible
Pytest version: 7.4.4 OS: Ubuntu 22.04 LTS I am facing below issues when using Proces, Manager, Queue modules from multiprocessing package. Issue 1: When running unit test case with make python-test job, when I press CNTRL+C, the the processes created with pytest remains there and does not terminate on its own.
Issue2: In integration test case, though the test case gets passed the pod created for pytest does not terminate and remains there.
The destructor code is as below: self.process_manager.shutdown() self.sub_process.terminate() self.sub_process.join()
After removing the multiprocessing modules pytest behaves normally.
Please guide in this regard to handle the multiprocessing with pytest. Please let me know if more inputs required. Awaiting for your response. Regards.
@roshant-ska pytest just executes the test functions, if they never return then pytest will get stuck.
Can you post a minimal example reproducing the problem? Multiprocessing is a complex topic, and many many things can go wrong, so we need to discuss solutions over a MWE.
This issue is stale because it has been open for 14 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.