Revision: 22055
Author:   [email protected]
Date:     Fri Jun 27 09:51:08 2014 UTC
Log:      Let test driver nuke test perf data on errors.

BUG=
[email protected]

Review URL: https://codereview.chromium.org/350913004
http://code.google.com/p/v8/source/detail?r=22055

Modified:
 /branches/bleeding_edge/tools/testrunner/local/execution.py

=======================================
--- /branches/bleeding_edge/tools/testrunner/local/execution.py Wed May 28 13:01:47 2014 UTC +++ /branches/bleeding_edge/tools/testrunner/local/execution.py Fri Jun 27 09:51:08 2014 UTC
@@ -27,6 +27,7 @@


 import os
+import shutil
 import time

 from pool import Pool
@@ -60,9 +61,10 @@
 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 @@
     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 @@
           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

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to