diff --git a/tools/run-tests.py b/tools/run-tests.py index 5824f250dd..794c864fb5 100755 --- a/tools/run-tests.py +++ b/tools/run-tests.py @@ -157,6 +157,9 @@ def BuildOptions(): result.add_option("--no-snap", "--nosnap", help='Test a build compiled without snapshot.', default=False, dest="no_snap", action="store_true") + result.add_option("--no-sorting", "--nosorting", + help="Don't sort tests according to duration of last run.", + default=False, dest="no_sorting", action="store_true") result.add_option("--no-stress", "--nostress", help="Don't run crankshaft --always-opt --stress-op test", default=False, dest="no_stress", action="store_true") @@ -411,7 +414,8 @@ def Execute(arch, mode, args, options, suites, workspace): options.command_prefix, options.extra_flags, options.no_i18n, - options.random_seed) + options.random_seed, + options.no_sorting) # TODO(all): Combine "simulator" and "simulator_run". simulator_run = not options.dont_skip_simulator_slow_tests and \ diff --git a/tools/testrunner/local/execution.py b/tools/testrunner/local/execution.py index 4dc62c2e90..80a5989be2 100644 --- a/tools/testrunner/local/execution.py +++ b/tools/testrunner/local/execution.py @@ -94,7 +94,9 @@ class Runner(object): # while the queue is filled. queue = [] queued_exception = None - for test in sorted(self.tests, key=lambda t: t.duration, reverse=True): + if not self.context.no_sorting: + self.tests = sorted(self.tests, key=lambda t: t.duration, reverse=True) + for test in self.tests: assert test.id >= 0 test_map[test.id] = test try: diff --git a/tools/testrunner/objects/context.py b/tools/testrunner/objects/context.py index 68c1989241..f8f764b3a6 100644 --- a/tools/testrunner/objects/context.py +++ b/tools/testrunner/objects/context.py @@ -28,7 +28,8 @@ class Context(): def __init__(self, arch, mode, shell_dir, mode_flags, verbose, timeout, - isolates, command_prefix, extra_flags, noi18n, random_seed): + isolates, command_prefix, extra_flags, noi18n, random_seed, + no_sorting): self.arch = arch self.mode = mode self.shell_dir = shell_dir @@ -40,15 +41,16 @@ class Context(): self.extra_flags = extra_flags self.noi18n = noi18n self.random_seed = random_seed + self.no_sorting = no_sorting def Pack(self): return [self.arch, self.mode, self.mode_flags, self.timeout, self.isolates, self.command_prefix, self.extra_flags, self.noi18n, - self.random_seed] + self.random_seed, self.no_sorting] @staticmethod def Unpack(packed): # For the order of the fields, refer to Pack() above. return Context(packed[0], packed[1], None, packed[2], False, packed[3], packed[4], packed[5], packed[6], packed[7], - packed[8]) + packed[8], packed[9])