diff options
author | Max Romanov <max.romanov@nginx.com> | 2021-08-11 19:01:04 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2021-08-11 19:01:04 +0300 |
commit | 5f67d30ec709ea101870d0a91db8953fc49c7810 (patch) | |
tree | 5ad76bab2b018002e7cd7ec6c751e5cf206752c1 | |
parent | 3580842d34f8543f7bb41551f7a0dec8723289a8 (diff) | |
download | unit-5f67d30ec709ea101870d0a91db8953fc49c7810.tar.gz unit-5f67d30ec709ea101870d0a91db8953fc49c7810.tar.bz2 |
Tests: retrying directory remove if resource is busy.
-rw-r--r-- | test/conftest.py | 9 |
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 |