Skip to content

Commit

Permalink
if process.exitcode is None: assert t_delta > 9.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Oct 30, 2022
1 parent 857ee1a commit 10b0334
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_gil_scoped.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import multiprocessing
import threading
import time

import pytest

Expand Down Expand Up @@ -149,9 +150,13 @@ def _run_in_process(target, *args, **kwargs):
process = multiprocessing.Process(target=target, args=args, kwargs=kwargs)
process.daemon = True
try:
t_start = time.time()
process.start()
# Do not need to wait much, 10s should be more than enough.
process.join(timeout=10)
t_delta = time.time() - t_start
if process.exitcode is None:
assert t_delta > 9.9
if process.exitcode == 66:
pass # NICE-TO-HAVE: Check output for ThreadSanitizer_exitcode_66_message
return process.exitcode
Expand Down

0 comments on commit 10b0334

Please sign in to comment.