Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "mach test-wpt --chaos" mode for reproducing intermittent failures using rr #9607

Merged
merged 3 commits into from Feb 11, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Add --repeat-until-unexpected option to wptrunner

  • Loading branch information
mbrubeck committed Feb 11, 2016
commit 6f55e949a1b272389f45811c59603c6c3076107a
@@ -72,6 +72,8 @@ def create_parser(product_choices=None):
help="Multiplier relative to standard test timeout to use")
parser.add_argument("--repeat", action="store", type=int, default=1,
help="Number of times to run the tests")
parser.add_argument("--repeat-until-unexpected", action="store_true", default=None,
help="Run tests in a loop until one returns an unexpected result")

parser.add_argument("--no-capture-stdio", action="store_true", default=False,
help="Don't capture stdio and write to logging")
@@ -160,10 +160,15 @@ def run_tests(config, test_paths, product, **kwargs):
browser_kwargs = get_browser_kwargs(ssl_env=ssl_env, **kwargs)

repeat = kwargs["repeat"]
for repeat_count in xrange(repeat):
if repeat > 1:
logger.info("Repetition %i / %i" % (repeat_count + 1, repeat))
repeat_count = 0
repeat_until_unexpected = kwargs["repeat_until_unexpected"]

while repeat_count < repeat or repeat_until_unexpected:
repeat_count += 1
if repeat_until_unexpected:
logger.info("Repetition %i" % (repeat_count))
elif repeat > 1:
logger.info("Repetition %i / %i" % (repeat_count, repeat))

unexpected_count = 0
logger.suite_start(test_loader.test_ids, run_info)
@@ -208,6 +213,8 @@ def run_tests(config, test_paths, product, **kwargs):

unexpected_total += unexpected_count
logger.info("Got %i unexpected results" % unexpected_count)
if repeat_until_unexpected and unexpected_total > 0:
break
logger.suite_end()

return unexpected_total == 0
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.