diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-01-04 00:42:06 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-01-04 00:42:06 +0530 |
commit | a99732aaf2e84e2c08e976f05e98e2d7aa96c7d5 (patch) | |
tree | ee90e7735b3ca2ffb53ecbefdae8d24e1b4a9982 | |
parent | 2589009d236442dfbaa7573343329baf5b1c3dd1 (diff) | |
download | meson-a99732aaf2e84e2c08e976f05e98e2d7aa96c7d5.zip meson-a99732aaf2e84e2c08e976f05e98e2d7aa96c7d5.tar.gz meson-a99732aaf2e84e2c08e976f05e98e2d7aa96c7d5.tar.bz2 |
Project tests: Also catch ValueError
It seems on Windows, deleting in a loop can cause a race where the
following error is raised:
Traceback (most recent call last):
File "run_project_tests.py", line 550, in <module>
(passing_tests, failing_tests, skipped_tests) = run_tests(all_tests, 'meson-test-run', options.extra_args)
File "run_project_tests.py", line 416, in run_tests
result = result.result()
File "C:\python34-x64\lib\concurrent\futures\_base.py", line 402, in result
return self.__get_result()
File "C:\python34-x64\lib\concurrent\futures\_base.py", line 354, in __get_result
raise self._exception
ValueError: I/O operation on closed file.
https://ci.appveyor.com/project/jpakkane/meson/build/1.0.1559/job/vsek754eu000kg3e
-rwxr-xr-x | run_project_tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index c26b885..18988fb 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -58,6 +58,11 @@ class AutoDeletedDir(): try: shutil.rmtree(self.dir) return + # Sometimes we get: ValueError: I/O operation on closed file. + except ValueError: + return + # Deleting can raise OSError or PermissionError on Windows + # (most likely because of anti-virus locking the file) except (OSError, PermissionError): if i == retries - 1: mlog.warning('Could not delete temporary directory.') |