| 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()
|
|
|