From a0df603aa78acee9be84594373d864f916327c92 Mon Sep 17 00:00:00 2001 From: evykassirer Date: Tue, 12 Sep 2023 14:08:19 -0700 Subject: [PATCH] puppeteer: Allow reruns in interactive mode when tests succeed. We already allowed reruns for failing tests, and this adds the ability to rerun tests that succeeded as well, which is helpful for debugging flaky tests. --- tools/test-js-with-puppeteer | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/test-js-with-puppeteer b/tools/test-js-with-puppeteer index f22bec9569..91fe2e5676 100755 --- a/tools/test-js-with-puppeteer +++ b/tools/test-js-with-puppeteer @@ -111,9 +111,12 @@ def run_tests(files: Iterable[str], external_host: str, loop: int = 1) -> None: response = input('Press Enter to run tests, "q" to quit: ') ret = 1 failed_test_num = 0 - while response != "q" and failed_test_num != -1: + while response != "q": ret, failed_test_num = run_tests(failed_test_num) - if ret != 0: + if ret == 0: + failed_test_num = 0 + response = input('Tests succeeded. Press Enter to re-run tests, "q" to quit: ') + else: response = input('Tests failed. Press Enter to re-run tests, "q" to quit: ') else: ret = 1