[Lldb-commits] [lldb] r256824 - Remove old flaky test rerun logic

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 5 02:44:36 PST 2016


Author: labath
Date: Tue Jan  5 04:44:36 2016
New Revision: 256824

URL: http://llvm.org/viewvc/llvm-project?rev=256824&view=rev
Log:
Remove old flaky test rerun logic

Summary:
This removes the old logic for rerunning flaky tests. The new test runners will take care of
rerunning failing tests.

Reviewers: tfiala

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D15855

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=256824&r1=256823&r2=256824&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Tue Jan  5 04:44:36 2016
@@ -752,14 +752,12 @@ def expectedFailureAndroid(bugnumber=Non
     """
     return expectedFailure(matchAndroid(api_levels, archs), bugnumber)
 
-# if the test passes on the first try, we're done (success)
-# if the test fails once, then passes on the second try, raise an ExpectedFailure
-# if the test fails twice in a row, re-throw the exception from the second test run
+# Flakey tests get two chances to run. If they fail the first time round, the result formatter
+# makes sure it is run one more time.
 def expectedFlakey(expected_fn, bugnumber=None):
     def expectedFailure_impl(func):
         @wraps(func)
         def wrapper(*args, **kwargs):
-            from unittest2 import case
             self = args[0]
             if expected_fn(self):
                 # Send event marking test as explicitly eligible for rerunning.
@@ -767,25 +765,7 @@ def expectedFlakey(expected_fn, bugnumbe
                     # Mark this test as rerunnable.
                     configuration.results_formatter_object.handle_event(
                         EventBuilder.event_for_mark_test_rerun_eligible(self))
-            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):
-                    # 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
-                        raise
-                    # record the expected failure
-                    raise case._ExpectedFailure(sys.exc_info(), bugnumber)
-                else:
-                    raise
+            func(*args, **kwargs)
         return wrapper
     # if bugnumber is not-callable(incluing None), that means decorator function is called with optional arguments
     # return decorator in this case, so it will be used to decorating original method




More information about the lldb-commits mailing list