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

Unified Diff: telemetry/telemetry/internal/story_runner.py

Issue 2997373002: WIP to improve Telemetry logging
Patch Set: Created 3 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
Index: telemetry/telemetry/internal/story_runner.py
diff --git a/telemetry/telemetry/internal/story_runner.py b/telemetry/telemetry/internal/story_runner.py
index 8928068ab3bdf89aaefb16edf51c7007a27ed7ea..073e4bcd22dbee92f4a97580ddbded197a409636 100644
--- a/telemetry/telemetry/internal/story_runner.py
+++ b/telemetry/telemetry/internal/story_runner.py
@@ -17,6 +17,7 @@ from telemetry.internal.actions import page_action
from telemetry.internal.browser import browser_finder
from telemetry.internal.results import results_options
from telemetry.internal.util import exception_formatter
+from telemetry.internal.util import log_stream
from telemetry import page
from telemetry.page import legacy_page_test
from telemetry import story as story_module
@@ -88,6 +89,9 @@ def _GenerateTagMapFromStorySet(stories):
def _RunStoryAndProcessErrorIfNeeded(story, results, state, test):
def ProcessError(description=None):
+ # Flush all the existing log upon failure.
+ log_stream.FlushLogStream(sys.stdout)
+
state.DumpStateUponFailure(story, results)
# Note: adding the FailureValue to the results object also normally
# cause the progress_reporter to log it in the output.
@@ -179,6 +183,7 @@ def Run(test, story_set, finder_options, results, max_failures=None,
try:
for storyset_repeat_counter in xrange(finder_options.pageset_repeat):
for story in stories:
+ log_stream.TruncateLogStream()
if not state:
# Construct shared state by using a copy of finder_options. Shared
# state may update the finder_options. If we tear down the shared
« no previous file with comments | « telemetry/telemetry/internal/browser/browser_options.py ('k') | telemetry/telemetry/internal/util/log_stream.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698