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

Unified Diff: webkit/tools/layout_tests/layout_package/test_shell_thread.py

Issue 63127: Print times for individual tests that take longer than 1 second to run. (Closed)
Patch Set: Made us spit out top 50 slowest tests Created 11 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: webkit/tools/layout_tests/layout_package/test_shell_thread.py
diff --git a/webkit/tools/layout_tests/layout_package/test_shell_thread.py b/webkit/tools/layout_tests/layout_package/test_shell_thread.py
index 61a5d876d9f448b7c906999316def0c50fddb50e..bd1e142c2fd44371d1a5df03b1de66ef8934ffb7 100644
--- a/webkit/tools/layout_tests/layout_package/test_shell_thread.py
+++ b/webkit/tools/layout_tests/layout_package/test_shell_thread.py
@@ -175,6 +175,7 @@ class TestShellThread(threading.Thread):
self._canceled = False
self._exception_info = None
self._timing_stats = {}
+ self._test_times = []
# Current directory of tests we're running.
self._current_dir = None
@@ -203,6 +204,11 @@ class TestShellThread(threading.Thread):
(number of tests in that directory, time to run the tests)"""
return self._timing_stats;
+ def GetIndividualTestTimingStats(self):
+ """Returns a list of (time, test_filename) tuples where time is the
+ time it took to run the test."""
+ return self._test_times
+
def Cancel(self):
"""Set a flag telling this thread to quit."""
self._canceled = True
@@ -339,10 +345,15 @@ class TestShellThread(threading.Thread):
# try to recover here.
self._test_shell_proc.stdin.flush()
+ start_time = time.time()
+
# ...and read the response
- return ProcessOutput(self._test_shell_proc, filename, test_uri,
- self._test_types, self._test_args,
- self._options.target)
+ failures = ProcessOutput(self._test_shell_proc, filename, test_uri,
+ self._test_types, self._test_args, self._options.target)
+
+ time_to_run_test = time.time() - start_time
+ self._test_times.append((time_to_run_test, filename))
+ return failures
def _EnsureTestShellIsRunning(self):
« no previous file with comments | « no previous file | webkit/tools/layout_tests/run_webkit_tests.py » ('j') | webkit/tools/layout_tests/run_webkit_tests.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698