OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 | 28 |
29 import os | 29 import os |
30 import shutil | 30 import shutil |
31 import time | 31 import time |
32 | 32 |
33 from pool import Pool | 33 from pool import Pool |
34 from . import commands | 34 from . import commands |
35 from . import perfdata | 35 from . import perfdata |
| 36 from . import statusfile |
36 from . import utils | 37 from . import utils |
37 | 38 |
38 | 39 |
39 class Job(object): | 40 class Job(object): |
40 def __init__(self, command, dep_command, test_id, timeout, verbose): | 41 def __init__(self, command, dep_command, test_id, timeout, verbose): |
41 self.command = command | 42 self.command = command |
42 self.dep_command = dep_command | 43 self.dep_command = dep_command |
43 self.id = test_id | 44 self.id = test_id |
44 self.timeout = timeout | 45 self.timeout = timeout |
45 self.verbose = verbose | 46 self.verbose = verbose |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 print("PerfData exception: %s" % e) | 92 print("PerfData exception: %s" % e) |
92 self.perf_failures = True | 93 self.perf_failures = True |
93 | 94 |
94 def _GetJob(self, test): | 95 def _GetJob(self, test): |
95 command = self.GetCommand(test) | 96 command = self.GetCommand(test) |
96 timeout = self.context.timeout | 97 timeout = self.context.timeout |
97 if ("--stress-opt" in test.flags or | 98 if ("--stress-opt" in test.flags or |
98 "--stress-opt" in self.context.mode_flags or | 99 "--stress-opt" in self.context.mode_flags or |
99 "--stress-opt" in self.context.extra_flags): | 100 "--stress-opt" in self.context.extra_flags): |
100 timeout *= 4 | 101 timeout *= 4 |
| 102 # FIXME(machenbach): Make this more OO. Don't expose default outcomes or |
| 103 # the like. |
| 104 if statusfile.IsSlow(test.outcomes or [statusfile.PASS]): |
| 105 timeout *= 2 |
101 if test.dependency is not None: | 106 if test.dependency is not None: |
102 dep_command = [ c.replace(test.path, test.dependency) for c in command ] | 107 dep_command = [ c.replace(test.path, test.dependency) for c in command ] |
103 else: | 108 else: |
104 dep_command = None | 109 dep_command = None |
105 return Job(command, dep_command, test.id, timeout, self.context.verbose) | 110 return Job(command, dep_command, test.id, timeout, self.context.verbose) |
106 | 111 |
107 def _MaybeRerun(self, pool, test): | 112 def _MaybeRerun(self, pool, test): |
108 if test.run <= self.context.rerun_failures_count: | 113 if test.run <= self.context.rerun_failures_count: |
109 # Possibly rerun this test if its run count is below the maximum per | 114 # Possibly rerun this test if its run count is below the maximum per |
110 # test. <= as the flag controls reruns not including the first run. | 115 # test. <= as the flag controls reruns not including the first run. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 test.suite.GetFlagsForTestCase(test, self.context) + | 265 test.suite.GetFlagsForTestCase(test, self.context) + |
261 self.context.extra_flags) | 266 self.context.extra_flags) |
262 return cmd | 267 return cmd |
263 | 268 |
264 | 269 |
265 class BreakNowException(Exception): | 270 class BreakNowException(Exception): |
266 def __init__(self, value): | 271 def __init__(self, value): |
267 self.value = value | 272 self.value = value |
268 def __str__(self): | 273 def __str__(self): |
269 return repr(self.value) | 274 return repr(self.value) |
OLD | NEW |