[Lldb-commits] [PATCH] D18912: sleep and retry on failure to delete temp file in tests

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 8 16:05:11 PDT 2016


zturner added inline comments.

================
Comment at: packages/Python/lldbsuite/test/lldbtest.py:1994
@@ +1993,3 @@
+# failure and retry.
+def remove_file(file, num_retries = 1, sleep_duration = 0.5):
+    while True:
----------------
I think the default for `num_retries` should be 0.  Usually you just want to try once without retry.

================
Comment at: packages/Python/lldbsuite/test/lldbtest.py:1995
@@ +1994,3 @@
+def remove_file(file, num_retries = 1, sleep_duration = 0.5):
+    while True:
+        try:
----------------
You could do `for i in range(num_retries+1):` and get rid of a bunch of the counter updating and junk


http://reviews.llvm.org/D18912





More information about the lldb-commits mailing list