Skip to content

Commit dfc96c3

Browse files
committed
Add timeout to child process join in tests.
1 parent 7cbcd0c commit dfc96c3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cuda_core/tests/memory_ipc/test_event_ipc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_main(self, ipc_device, ipc_memory_resource):
5858

5959
log("releasing stream1")
6060
latch.release()
61-
process.join()
61+
process.join(timeout=CHILD_TIMEOUT_SEC)
6262
assert process.exitcode == 0
6363
log("done")
6464

@@ -150,7 +150,7 @@ def test_main(self, ipc_device, busy_waited_sync, use_options_cls, use_option_kw
150150
assert props[4] is None
151151
assert props[5] is None
152152

153-
process.join()
153+
process.join(timeout=CHILD_TIMEOUT_SEC)
154154
assert process.exitcode == 0
155155

156156
def child_main(self, q_in, q_out):

cuda_core/tests/memory_ipc/test_leaks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def exec_success(obj, number=1):
3636
for _ in range(number):
3737
process = mp.Process(target=child_main, args=(obj,))
3838
process.start()
39-
process.join()
39+
process.join(timeout=CHILD_TIMEOUT_SEC)
4040
assert process.exitcode == 0
4141

4242

@@ -52,7 +52,7 @@ def exec_launch_failure(obj, number=1):
5252
for _ in range(number):
5353
process = mp.Process(target=child_main_bad, args=(obj,))
5454
process.start()
55-
process.join()
55+
process.join(timeout=CHILD_TIMEOUT_SEC)
5656
assert process.exitcode != 0
5757

5858

@@ -135,6 +135,6 @@ def prime():
135135
if not prime_was_run:
136136
process = mp.Process()
137137
process.start()
138-
process.join()
138+
process.join(timeout=CHILD_TIMEOUT_SEC)
139139
assert process.exitcode == 0
140140
prime_was_run = True

0 commit comments

Comments
 (0)