Commit 4d4f3533 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

testsuite: Rip out hack for #12554

@Phyx is working on correctly fixing (pun intended) the underlying issue
that prompted this hack. It turns out that `timeout` it the culprit.
Moreover, this hack breaks on msys python builds, which don't export
`WindowsError`.

Test Plan: Validate on Windows with `msys` python.

Reviewers: Phyx, austin

Subscribers: thomie, Phyx

Differential Revision: https://phabricator.haskell.org/D2724

GHC Trac Issues: #12554
parent 20fb781e
......@@ -1850,16 +1850,7 @@ def find_expected_file(name, suff):
return basename
# Windows seems to exhibit a strange behavior where processes' executables
# remain locked even after the process itself has died. When this happens
# rmtree will fail with either Error 5 or Error 32. It takes some time for this
# to resolve so we try several times to delete the directory, only eventually
# failing if things seem really stuck. See #12554.
if config.msys:
try:
from exceptions import WindowsError
except:
pass
import stat
def cleanup():
def on_error(function, path, excinfo):
......@@ -1871,21 +1862,7 @@ if config.msys:
os.unlink(path)
testdir = getTestOpts().testdir
attempts = 0
max_attempts = 10
while attempts < max_attempts and os.path.exists(testdir):
try:
shutil.rmtree(testdir, ignore_errors=False, onerror=on_error)
except WindowsError as e:
#print('failed deleting %s: %s' % (testdir, e))
if e.winerror in [5, 32]:
attempts += 1
if attempts == max_attempts:
raise e
else:
time.sleep(0.1)
else:
raise e
shutil.rmtree(testdir, ignore_errors=False, onerror=on_error)
else:
def cleanup():
testdir = getTestOpts().testdir
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment