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

Side by Side Diff: tools/testrunner/local/execution.py

Issue 1385443002: [Swarming] Presort tests - slowest first. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: meh Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « test/simdjs/simdjs.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 def __init__(self, suites, progress_indicator, context): 65 def __init__(self, suites, progress_indicator, context):
66 self.datapath = os.path.join("out", "testrunner_data") 66 self.datapath = os.path.join("out", "testrunner_data")
67 self.perf_data_manager = perfdata.PerfDataManager(self.datapath) 67 self.perf_data_manager = perfdata.PerfDataManager(self.datapath)
68 self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode) 68 self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode)
69 self.perf_failures = False 69 self.perf_failures = False
70 self.printed_allocations = False 70 self.printed_allocations = False
71 self.tests = [ t for s in suites for t in s.tests ] 71 self.tests = [ t for s in suites for t in s.tests ]
72 if not context.no_sorting: 72 if not context.no_sorting:
73 for t in self.tests: 73 for t in self.tests:
74 t.duration = self.perfdata.FetchPerfData(t) or 1.0 74 t.duration = self.perfdata.FetchPerfData(t) or 1.0
75 slow_key = lambda t: statusfile.IsSlow(t.outcomes)
76 self.tests.sort(key=slow_key, reverse=True)
75 self.tests.sort(key=lambda t: t.duration, reverse=True) 77 self.tests.sort(key=lambda t: t.duration, reverse=True)
76 self._CommonInit(suites, progress_indicator, context) 78 self._CommonInit(suites, progress_indicator, context)
77 79
78 def _CommonInit(self, suites, progress_indicator, context): 80 def _CommonInit(self, suites, progress_indicator, context):
79 self.total = 0 81 self.total = 0
80 for s in suites: 82 for s in suites:
81 for t in s.tests: 83 for t in s.tests:
82 t.id = self.total 84 t.id = self.total
83 self.total += 1 85 self.total += 1
84 self.indicator = progress_indicator 86 self.indicator = progress_indicator
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 test.suite.GetFlagsForTestCase(test, self.context) + 289 test.suite.GetFlagsForTestCase(test, self.context) +
288 self.context.extra_flags) 290 self.context.extra_flags)
289 return cmd 291 return cmd
290 292
291 293
292 class BreakNowException(Exception): 294 class BreakNowException(Exception):
293 def __init__(self, value): 295 def __init__(self, value):
294 self.value = value 296 self.value = value
295 def __str__(self): 297 def __str__(self):
296 return repr(self.value) 298 return repr(self.value)
OLDNEW
« no previous file with comments | « test/simdjs/simdjs.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698