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

Unified Diff: tools/testrunner/local/execution.py

Issue 350913004: Let test driver nuke test perf data on errors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 6 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testrunner/local/execution.py
diff --git a/tools/testrunner/local/execution.py b/tools/testrunner/local/execution.py
index ac69eab3c912c81f4a7eeb78ab727a0055e6503f..79f856c7d7da21a4319edbd5424af557623336ec 100644
--- a/tools/testrunner/local/execution.py
+++ b/tools/testrunner/local/execution.py
@@ -27,6 +27,7 @@
import os
+import shutil
import time
from pool import Pool
@@ -60,9 +61,10 @@ def RunTest(job):
class Runner(object):
def __init__(self, suites, progress_indicator, context):
- datapath = os.path.join("out", "testrunner_data")
- self.perf_data_manager = perfdata.PerfDataManager(datapath)
+ self.datapath = os.path.join("out", "testrunner_data")
+ self.perf_data_manager = perfdata.PerfDataManager(self.datapath)
self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode)
+ self.perf_failures = False
self.tests = [ t for s in suites for t in s.tests ]
if not context.no_sorting:
for t in self.tests:
@@ -80,6 +82,13 @@ class Runner(object):
self.failed = []
self.crashed = 0
+ def _RunPerfSafe(self, fun):
+ try:
+ fun()
+ except Exception, e:
+ print("PerfData exception: %s" % e)
+ self.perf_failures = True
+
def Run(self, jobs):
self.indicator.Starting()
self._RunInternal(jobs)
@@ -130,17 +139,18 @@ class Runner(object):
if test.output.HasCrashed():
self.crashed += 1
else:
+ self._RunPerfSafe(lambda: self.perfdata.UpdatePerfData(test))
self.succeeded += 1
self.remaining -= 1
- try:
- self.perfdata.UpdatePerfData(test)
- except Exception, e:
- print("UpdatePerfData exception: %s" % e)
- pass # Just keep working.
self.indicator.HasRun(test, has_unexpected_output)
finally:
pool.terminate()
- self.perf_data_manager.close()
+ self._RunPerfSafe(lambda: self.perf_data_manager.close())
+ if self.perf_failures:
+ # Nuke perf data in case of failures. This might not work on windows as
+ # some files might still be open.
+ print "Deleting perf test data due to db corruption."
+ shutil.rmtree(self.datapath)
if queued_exception:
raise queued_exception
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698