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
pull/1253/head
Nirbheek Chauhan 8 years ago
parent 2589009d23
commit a99732aaf2
  1. 5
      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.')

Loading…
Cancel
Save