diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2021-10-12 14:01:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-12 14:01:52 +0200 |
commit | c2bf585d171a37defceec25f3823b7633787b8c6 (patch) | |
tree | 9d6cb1e164af714aa9f17d6cffc7ad041bfaaab8 | |
parent | 66b32b337fbf8eb125da0c94f359d8887742c30a (diff) | |
download | spack-c2bf585d171a37defceec25f3823b7633787b8c6.tar.gz spack-c2bf585d171a37defceec25f3823b7633787b8c6.tar.bz2 spack-c2bf585d171a37defceec25f3823b7633787b8c6.tar.xz spack-c2bf585d171a37defceec25f3823b7633787b8c6.zip |
Fix potentially broken shutil.rmtree in tests (#26665)
Seems like https://bugs.python.org/issue29699 is relevant. Better to
just ignore errors when removing them tmpdir. The OS will remove it
anyways.
Errors are happening randomly from tests that are using this fixture.
-rw-r--r-- | lib/spack/spack/test/conftest.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/test/conftest.py b/lib/spack/spack/test/conftest.py index 17086dbdc0..9a6dc0b13b 100644 --- a/lib/spack/spack/test/conftest.py +++ b/lib/spack/spack/test/conftest.py @@ -971,7 +971,10 @@ def mock_gnupghome(monkeypatch): yield short_name_tmpdir # clean up, since we are doing this manually - shutil.rmtree(short_name_tmpdir) + # Ignore errors cause we seem to be hitting a bug similar to + # https://bugs.python.org/issue29699 in CI (FileNotFoundError: [Errno 2] No such + # file or directory: 'S.gpg-agent.extra'). + shutil.rmtree(short_name_tmpdir, ignore_errors=True) ########## # Fake archives and repositories |