Commit ebbaf2b7 authored by Liviu Rau's avatar Liviu Rau Committed by Commit Bot

Collect 100 slow tests by default

If we do not want _all_ tests durations, it makes sense to reuse the existing slow test collection and aggregation

Bug: v8:10168
Change-Id: I500acdb799f41ee6f0fb2c57afb95e1e1830b2dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2064221
Auto-Submit: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tamer Tas <tmrts@chromium.org>
Reviewed-by: 's avatarTamer Tas <tmrts@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66342}
parent c12f395d
......@@ -344,8 +344,8 @@ class BaseTestRunner(object):
"color, mono)")
parser.add_option("--json-test-results",
help="Path to a file for storing json results.")
parser.add_option('--json-test-times',
help='Path to a file for storing json test times.')
parser.add_option('--slow-tests-cutoff', type="int", default=100,
help='Collect N slowest tests')
parser.add_option("--exit-after-n-failures", type="int", default=100,
help="Exit after the first N failures instead of "
"running all tests. Pass 0 to disable this feature.")
......
......@@ -385,7 +385,8 @@ class JsonTestProgressIndicator(ProgressIndicator):
# Sort tests by duration.
self.tests.sort(key=lambda __duration_cmd: __duration_cmd[1], reverse=True)
slowest_tests = self._test_records(self.tests[:20])
cutoff = self.options.slow_tests_cutoff
slowest_tests = self._test_records(self.tests[:cutoff])
complete_results.append({
"arch": self.arch,
......@@ -399,8 +400,6 @@ class JsonTestProgressIndicator(ProgressIndicator):
with open(self.options.json_test_results, "w") as f:
f.write(json.dumps(complete_results))
self._save_test_times()
def _test_records(self, tests):
return [
{
......@@ -411,9 +410,3 @@ class JsonTestProgressIndicator(ProgressIndicator):
"marked_slow": test.is_slow,
} for (test, duration, cmd) in tests
]
def _save_test_times(self):
if self.options.json_test_times:
test_times = self._test_records(self.tests)
with open(self.options.json_test_times, "w") as f:
f.write(json.dumps(test_times))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment