mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-27 23:45:01 +03:00
Handle PermissionError in Windows CI
This commit is contained in:
parent
b48f2e1494
commit
522b0edc8c
|
@ -218,15 +218,16 @@ def test_project_run_multiprocessing_failure(failing_command: str):
|
|||
with a non-zero return code, the other two commands after several seconds with
|
||||
zero return codes. Measuring the execution length for the whole group shows
|
||||
whether or not the sleeping processes were successfully terminated."""
|
||||
try:
|
||||
with make_tempdir() as d:
|
||||
|
||||
pscript = """
|
||||
import sys
|
||||
from time import sleep
|
||||
import sys
|
||||
from time import sleep
|
||||
|
||||
_, sleep_secs, rc = sys.argv
|
||||
sleep(int(sleep_secs))
|
||||
sys.exit(int(rc))
|
||||
_, sleep_secs, rc = sys.argv
|
||||
sleep(int(sleep_secs))
|
||||
sys.exit(int(rc))
|
||||
"""
|
||||
|
||||
pscript_loc = os.sep.join((str(d), "pscript.py"))
|
||||
|
@ -267,9 +268,11 @@ sys.exit(int(rc))
|
|||
else:
|
||||
assert rc_e.value.code == 1
|
||||
time_taken = time() - start
|
||||
print("time_taken:", time_taken)
|
||||
assert (
|
||||
time_taken < 15
|
||||
), "Test took {time_taken}, subprocess seems not to have been terminated"
|
||||
except PermissionError: # occurs on Windows in the CI because the terminated subprocess still has
|
||||
# a handle on the temporary directory
|
||||
pass
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user