Skip to content

Commit 0b8c280

Browse files
committed
Race conditions on Windows during tests
1 parent a84d908 commit 0b8c280

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import os
22
import sys
3+
import time
34
import shlex
45
import contextlib
56
from nimporter.lib import run_process, PYTHON
67

78

89
@contextlib.contextmanager
910
def temporarily_install_nimporter():
11+
# Hopefully prevent permission denied errors in CI when deleting artifacts
12+
time.sleep(5)
13+
1014
try:
1115
code, _, _ = run_process(
1216
shlex.split(f'{PYTHON} setup.py install --force'),

tests/test_nexporting.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
import time
23
import shlex
34
from zipfile import ZipFile
45
from tests import temporarily_install_nimporter
@@ -104,6 +105,7 @@ def test_bdist_wheel_all_targets_installs_correctly():
104105
shlex.split(f'{PYTHON} -m pip uninstall test_nimporter -y'),
105106
'NIMPORTER_INSTRUMENT' in os.environ
106107
)
108+
time.sleep(5)
107109

108110

109111
def test_sdist_all_targets_installs_correctly():
@@ -155,6 +157,7 @@ def test_sdist_all_targets_installs_correctly():
155157
shlex.split(f'{PYTHON} -m pip uninstall test_nimporter -y'),
156158
'NIMPORTER_INSTRUMENT' in os.environ
157159
)
160+
time.sleep(5)
158161

159162

160163
def test_setup_py_all_targets_installs_correctly():
@@ -194,3 +197,4 @@ def test_setup_py_all_targets_installs_correctly():
194197
shlex.split(f'{PYTHON} -m pip uninstall test_nimporter -y'),
195198
'NIMPORTER_INSTRUMENT' in os.environ
196199
)
200+
time.sleep(5)

0 commit comments

Comments
 (0)