]> granicus.if.org Git - python/commitdiff
More random thrashing trying to understand spurious
authorTim Peters <tim.peters@gmail.com>
Sat, 27 May 2006 12:36:53 +0000 (12:36 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 27 May 2006 12:36:53 +0000 (12:36 +0000)
Windows failures.  Who's keeping a bz2 file open?

Lib/test/test_tarfile.py

index 8ee0f41ea8b8b9e474de52b0941d8ba04784877a..62423da028528c264576838fff5f4e83b639d9f6 100644 (file)
@@ -633,7 +633,19 @@ def test_main():
         if gzip:
             os.remove(tarname("gz"))
         if bz2:
-            os.remove(tarname("bz2"))
+            # Grrr.  This frequently blows up on the Windows buildbot
+            # slaves.  No idea why.  Adding more output to try to guess
+            # something.  Can't reproduce at will.
+            import time, sys
+            for dummy in range(10):
+                try:
+                    os.remove(tarname("bz2"))
+                except OSError, msg:
+                    print >> sys.stderr, \
+                        "test_tarfile final cleanup crapped out %s" % msg
+                    time.sleep(1)
+                else:
+                    break
         if os.path.exists(dirname()):
             shutil.rmtree(dirname())
         if os.path.exists(tmpname()):