Skip to content

Commit 10b0334

Browse files
committed
if process.exitcode is None: assert t_delta > 9.9
1 parent 857ee1a commit 10b0334

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_gil_scoped.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import multiprocessing
22
import threading
3+
import time
34

45
import pytest
56

@@ -149,9 +150,13 @@ def _run_in_process(target, *args, **kwargs):
149150
process = multiprocessing.Process(target=target, args=args, kwargs=kwargs)
150151
process.daemon = True
151152
try:
153+
t_start = time.time()
152154
process.start()
153155
# Do not need to wait much, 10s should be more than enough.
154156
process.join(timeout=10)
157+
t_delta = time.time() - t_start
158+
if process.exitcode is None:
159+
assert t_delta > 9.9
155160
if process.exitcode == 66:
156161
pass # NICE-TO-HAVE: Check output for ThreadSanitizer_exitcode_66_message
157162
return process.exitcode

0 commit comments

Comments
 (0)