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

Adrian McCarthy via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 8 16:31:40 PDT 2016


amccarth 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:
----------------
zturner wrote:
> I think the default for `num_retries` should be 0.  Usually you just want to try once without retry.
I disagree.  Every call site was already doing exactly one retry.  I don't see value in making each of them specify that explicitly.

================
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:
----------------
zturner wrote:
> You could do `for i in range(num_retries+1):` and get rid of a bunch of the counter updating and junk
Fine, but that changes the behavior a bit.  My approach avoided that extra sleep after the last retry.


http://reviews.llvm.org/D18912





More information about the lldb-commits mailing list