Skip to content

Commit

Permalink
wait 1 sec between raising the error and seeing if all children are d…
Browse files Browse the repository at this point in the history
…ead (#138)
  • Loading branch information
sroet authored Mar 1, 2024
1 parent b246fb3 commit a2c8ff1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test00_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""
import unittest
import pathlib
import time
import numpy as np
import voltools as vt
import multiprocessing
Expand Down Expand Up @@ -74,6 +75,8 @@ def test_parallel_breaking(self):
try:
_ = run_job_parallel(self.job, volume_splits=(1, 2, 1), gpu_ids=[0, -1], unittest_mute=True)
except RuntimeError:
# sleep a second to make sure all children are cleaned
time.sleep(1)
self.assertEqual(len(multiprocessing.active_children()), 0,
msg='a process was still lingering after a parallel job with partially invalid resources '
'was started')
Expand Down

0 comments on commit a2c8ff1

Please sign in to comment.