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

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

Issue 273613005: Run tests sorted by expected runtime. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 6 years, 7 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/testrunner/local/perfdata.py » ('j') | 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 80d881bc0e3229f24be3fe427c046f6058120ede..c095ea6c8554131951b00c123c0170e2b0e555a1 100644
--- a/tools/testrunner/local/execution.py
+++ b/tools/testrunner/local/execution.py
@@ -31,6 +31,7 @@ import time
from pool import Pool
from . import commands
+from . import perfdata
from . import utils
@@ -59,7 +60,12 @@ 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.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode)
self.tests = [ t for s in suites for t in s.tests ]
+ for t in self.tests:
+ t.duration = self.perfdata.FetchPerfData(t) or 1.0
self._CommonInit(len(self.tests), progress_indicator, context)
def _CommonInit(self, num_tests, progress_indicator, context):
@@ -88,7 +94,7 @@ class Runner(object):
# while the queue is filled.
queue = []
queued_exception = None
- for test in self.tests:
+ for test in sorted(self.tests, key=lambda t: t.duration, reverse=True):
assert test.id >= 0
test_map[test.id] = test
try:
@@ -124,6 +130,11 @@ class Runner(object):
else:
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()
« no previous file with comments | « no previous file | tools/testrunner/local/perfdata.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698