[Lldb-commits] [PATCH] D12641: Work around a race condition in lldbtest.py for Windows.

Adrian McCarthy via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 4 11:32:43 PDT 2015


amccarth created this revision.
amccarth added a reviewer: zturner.
amccarth added a subscriber: lldb-commits.

Allows about 10 passing tests to succeed rather than fail due to log file juggling.

http://reviews.llvm.org/D12641

Files:
  test/lldbtest.py

Index: test/lldbtest.py
===================================================================
--- test/lldbtest.py
+++ test/lldbtest.py
@@ -1791,7 +1791,12 @@
         else:
             # success!  (and we don't want log files) delete log files
             for log_file in log_files_for_this_test:
-                os.unlink(log_file)
+                try:
+                    os.unlink(log_file)
+                except:
+                    # This can be racey on Windows, so sleep and try again.
+                    time.sleep(0.5)
+                    os.unlink(log_file)
 
     # ====================================================
     # Config. methods supported through a plugin interface


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12641.34053.patch
Type: text/x-patch
Size: 700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150904/842e2a12/attachment.bin>


More information about the lldb-commits mailing list