Skip to content

Commit

Permalink
Run teardown and setup before retry for expectedFlakey tests
Browse files Browse the repository at this point in the history
Summary:
If test is decorated with expectedFlakey*, run teardown and setup before retry
Don't run retry if the test is already decorated with xfail or skip

Test Plan:
Mark TestMultithreaded.test_sb_api_listener_event_process_state as expectedFlakey
Run ./dotest.py -p TestMultithreaded.py -A x86_64 -C gcc4.9.2

Reviewers: vharron, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 241202
  • Loading branch information
chyingo committed Jul 1, 2015
1 parent 84f9042 commit 0a7202b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lldb/test/lldbtest.py
Expand Up @@ -723,10 +723,15 @@ def wrapper(*args, **kwargs):
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
Expand Down

0 comments on commit 0a7202b

Please sign in to comment.