diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2015-12-11 18:06:47 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2015-12-11 18:06:47 +0000 |
commit | 9187f27e3252446035dfe0e9c4ffa8f3094c3774 (patch) | |
tree | f0df2c07080bc95031a93f89e9b29b51237ce4cc /lldb/packages/Python/lldbsuite/test/lldbtest.py | |
parent | 841b1732dfcf7293094c4aab811e976945bf7977 (diff) | |
download | bcm5719-llvm-9187f27e3252446035dfe0e9c4ffa8f3094c3774.tar.gz bcm5719-llvm-9187f27e3252446035dfe0e9c4ffa8f3094c3774.zip |
Add test event marking a test as explicitly eligible for rerun if it is marked flakey.
This will be used in a future change to support rerunning flakey tests
that hit a test result isue in a low-load, single worker test runner phase.
This is implemented as an additive-style event rather than being
evaluated and added to the start_test event because the decorator code
only runs after the start_test event is created and sent. i.e.
LLDBTestResult.startTest() runs before the test method decorators run.
llvm-svn: 255351
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbtest.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index 0de836d4772..34481a2d0d2 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -63,6 +63,8 @@ from . import lldbtest_config from . import lldbutil from . import test_categories +from .result_formatter import EventBuilder + # dosep.py starts lots and lots of dotest instances # This option helps you find if two (or more) dotest instances are using the same # directory at the same time @@ -784,6 +786,12 @@ def expectedFlakey(expected_fn, bugnumber=None): def wrapper(*args, **kwargs): from unittest2 import case self = args[0] + if expected_fn(self): + # Send event marking test as explicitly eligible for rerunning. + if configuration.results_formatter_object is not None: + # 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 |