Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: tools/telemetry/telemetry/page/page_runner.py

Issue 439553002: Move output of [OK] and [FAILED] from AddValue to DidRunPage for gtest output. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/results/buildbot_output_formatter_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/page_runner.py
diff --git a/tools/telemetry/telemetry/page/page_runner.py b/tools/telemetry/telemetry/page/page_runner.py
index 4dfa2ca5c9cea78efbec44e4e6e0d9d190808e67..ccdb891ce2f74f323bc7bdb1a4f4fe9cc435ca01 100644
--- a/tools/telemetry/telemetry/page/page_runner.py
+++ b/tools/telemetry/telemetry/page/page_runner.py
@@ -242,11 +242,12 @@ def _PrepareAndRunPage(test, page_set, expectations, finder_options,
if page.archive_path and os.path.isfile(page.archive_path)
else wpr_modes.WPR_OFF)
- tries = test.attempts
- while tries:
- tries -= 1
+ max_attempts = test.attempts
+ attempt_num = 0
+ while attempt_num < max_attempts:
+ attempt_num = attempt_num + 1
try:
- results.WillAttemptPageRun()
+ results.WillAttemptPageRun(attempt_num, max_attempts)
if test.RestartBrowserBeforeEachPage() or page.startup_url:
state.StopBrowser()
@@ -287,7 +288,7 @@ def _PrepareAndRunPage(test, page_set, expectations, finder_options,
return
except exceptions.BrowserGoneException as e:
state.StopBrowser()
- if not tries:
+ if attempt_num == max_attempts:
logging.error('Aborting after too many retries')
raise
if test.is_multi_tab_test:
@@ -521,7 +522,6 @@ def _RunPage(test, page, state, expectation, results, finder_options):
def ProcessError():
if expectation == 'fail':
msg = 'Expected exception while running %s' % page.url
- results.AddSuccess(page)
else:
msg = 'Exception while running %s' % page.url
results.AddValue(failure.FailureValue(page, sys.exc_info()))
@@ -540,7 +540,6 @@ def _RunPage(test, page, state, expectation, results, finder_options):
if expectation == 'fail':
exception_formatter.PrintFormattedException(
msg='Expected failure while running %s' % page.url)
- results.AddSuccess(page)
else:
exception_formatter.PrintFormattedException(
msg='Failure while running %s' % page.url)
@@ -561,7 +560,6 @@ def _RunPage(test, page, state, expectation, results, finder_options):
else:
if expectation == 'fail':
logging.warning('%s was expected to fail, but passed.\n', page.url)
- results.AddSuccess(page)
finally:
page_state.CleanUpPage(test)
« no previous file with comments | « no previous file | tools/telemetry/telemetry/results/buildbot_output_formatter_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698