Based on feedback, handle teardown and setup inside of expectedFlakey function.
Don't run retry if the test case is already marked as xfail or skip.


http://reviews.llvm.org/D10830

Files:
  test/lldbtest.py

Index: test/lldbtest.py
===================================================================
--- test/lldbtest.py
+++ test/lldbtest.py
@@ -723,10 +723,15 @@
             self = args[0]
             try:
                 func(*args, **kwargs)
+            # don't retry if the test case is already decorated with xfail or 
skip
+            except (case._ExpectedFailure, case.SkipTest, 
case._UnexpectedSuccess):
+                raise
             except Exception:
                 if expected_fn(self):
-                    # retry
+                    # before retry, run tearDown for previous run and setup 
for next
                     try:
+                        self.tearDown()
+                        self.setUp()
                         func(*args, **kwargs)
                     except Exception:
                         # oh snap! two failures in a row, record a 
failure/error

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
Index: test/lldbtest.py
===================================================================
--- test/lldbtest.py
+++ test/lldbtest.py
@@ -723,10 +723,15 @@
             self = args[0]
             try:
                 func(*args, **kwargs)
+            # don't retry if the test case is already decorated with xfail or skip
+            except (case._ExpectedFailure, case.SkipTest, case._UnexpectedSuccess):
+                raise
             except Exception:
                 if expected_fn(self):
-                    # retry
+                    # before retry, run tearDown for previous run and setup for next
                     try:
+                        self.tearDown()
+                        self.setUp()
                         func(*args, **kwargs)
                     except Exception:
                         # oh snap! two failures in a row, record a failure/error
_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to