From 3c41aafc6cf5f16cfd56db12bb3d89463827d81a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 21 Mar 2010 16:57:21 -0400 Subject: Yet more chainsaw action to try to prevent spurious test failures on Windows 7 --- alltests.cmd | 3 +++ test/test_farm.py | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/alltests.cmd b/alltests.cmd index 7285818..759a4f5 100644 --- a/alltests.cmd +++ b/alltests.cmd @@ -1,4 +1,7 @@ @echo off +@rem all the Python installs have a .pth pointing to the egg file created by +@rem 2.5, so install the testdata in 2.5 +call \ned\bin\switchpy 25 quiet make --quiet testdata for %%v in (23 24 25 26 27) do ( diff --git a/test/test_farm.py b/test/test_farm.py index 08e51cd..79b345a 100644 --- a/test/test_farm.py +++ b/test/test_farm.py @@ -294,10 +294,12 @@ class FarmTestCase(object): def clean(self, cleandir): """Clean `cleandir` by removing it and all its children completely.""" - if os.path.exists(cleandir): - # rmtree gives mysterious failures on Win7, so retry a few times. - tries = 3 - while tries: + # rmtree gives mysterious failures on Win7, so retry a "few" times. + # I've seen it take over 100 tries, so, 1000! This is probably the + # most unpleasant hack I've written in a long time... + tries = 1000 + while tries: + if os.path.exists(cleandir): try: shutil.rmtree(cleandir) except OSError: @@ -306,7 +308,7 @@ class FarmTestCase(object): else: tries -= 1 continue - break + break def main(): # pragma: no cover -- cgit v1.2.1