[Git][ghc/ghc][master] testsuite: fix testdir cleanup logic on Windows
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: ed2c6570 by Cheng Shao at 2026-03-31T04:42:33-04:00 testsuite: fix testdir cleanup logic on Windows testdir cleanup is unreliable on Windows (#13162) and despite existing hacks in the driver, new failure mode has occurred. This patch makes it print the warning and carry on when failed to clean up a testdir, instead of reporting a spurious framework failure. See added comment for detailed explanation. - - - - - 1 changed file: - testsuite/driver/testlib.py Changes: ===================================== testsuite/driver/testlib.py ===================================== @@ -25,7 +25,7 @@ from testglobals import config, ghc_env, default_testopts, brokens, t, \ from testutil import strip_quotes, lndir, link_or_copy_file, passed, \ failBecause, testing_metrics, residency_testing_metrics, \ stable_perf_counters, \ - PassFail, badResult, memoize, str_removeprefix + PassFail, badResult, str_warn, str_removeprefix from term_color import Color, colored import testutil from cpu_features import have_cpu_feature @@ -3459,9 +3459,20 @@ if config.msys: exception = e retries -= 1 + # Don't fail as framework error if cleanup fails here, just + # print the warning and proceed. I've seen new failure mode + # here on Windows Server 2025 and recent msys2 installation: + # fifo.lnk is created as read-only and the on_error trick + # above somehow doesn't work. + # + # For a local testsuite run, it's in %TEMP% that will be + # periodically cleaned up anyway; for CI, there's post-job + # cleanup and runner level cleanup. It's better to report + # actual job pass/failure than to waste CPU cycles to spurious + # Windows misery. if retries == 0 and testdir.exists(): - raise Exception("Unable to remove folder '%s': %s\nUnable to start current test." - % (testdir, exception)) + print(str_warn("Unable to remove folder '%s': %s\nUnable to start current test." + % (testdir, exception))) else: def cleanup() -> None: testdir = getTestOpts().testdir_raw View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ed2c65707aacdf442edb8098a7e5cea5... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ed2c65707aacdf442edb8098a7e5cea5... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)