summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2021-08-11 19:01:04 +0300
committerMax Romanov <max.romanov@nginx.com>2021-08-11 19:01:04 +0300
commit5f67d30ec709ea101870d0a91db8953fc49c7810 (patch)
tree5ad76bab2b018002e7cd7ec6c751e5cf206752c1 /test
parent3580842d34f8543f7bb41551f7a0dec8723289a8 (diff)
downloadunit-5f67d30ec709ea101870d0a91db8953fc49c7810.tar.gz
unit-5f67d30ec709ea101870d0a91db8953fc49c7810.tar.bz2
Tests: retrying directory remove if resource is busy.
Diffstat (limited to 'test')
-rw-r--r--test/conftest.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/conftest.py b/test/conftest.py
index 87471287..ea3aaf72 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -328,7 +328,14 @@ def run(request):
):
os.remove(path)
else:
- shutil.rmtree(path)
+ for attempt in range(10):
+ try:
+ shutil.rmtree(path)
+ break
+ except OSError as err:
+ if err.errno != 16:
+ raise
+ time.sleep(1)
# check descriptors