Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Prev Previous commit
Next Next commit
FIX dangling process in test_sem_tracker
  • Loading branch information
tomMoral committed Mar 17, 2019
commit b61bba22489d03d28607461de8e65507a39a70ae
5 changes: 5 additions & 0 deletions Lib/test/_test_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4883,6 +4883,11 @@ def check_semaphore_tracker_death(self, signum, should_die):
else:
self.assertEqual(len(all_warn), 0)

# make sure to clean-up the killed semaphore_tracker to avoid dangling
# processes.
if signum == signal.SIGKILL:
os.waitpid(pid, 0)

def test_semaphore_tracker_sigint(self):
# Catchable signal (ignored by semaphore tracker)
self.check_semaphore_tracker_death(signal.SIGINT, False)
Expand Down