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

Unified Diff: base/test/unit_test_launcher.cc

Issue 24255017: GTTF: add independent test timeout for the test launcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
« no previous file with comments | « base/test/test_timeouts.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/unit_test_launcher.cc
diff --git a/base/test/unit_test_launcher.cc b/base/test/unit_test_launcher.cc
index af2998aa816cb7514479d8426bba50c12968fc4e..daf264d8309c1221ebd1344d067dab3313c85099 100644
--- a/base/test/unit_test_launcher.cc
+++ b/base/test/unit_test_launcher.cc
@@ -159,7 +159,7 @@ class UnitTestLauncherDelegate : public TestLauncherDelegate {
// Note: do NOT parse child's stdout to do that, it's known to be
// unreliable (e.g. buffering issues can mix up the output).
base::TimeDelta timeout =
- test_names.size() * TestTimeouts::action_timeout();
+ test_names.size() * TestTimeouts::test_launcher_timeout();
parallel_launcher_.LaunchChildGTestProcess(
cmd_line,
@@ -234,6 +234,17 @@ class UnitTestLauncherDelegate : public TestLauncherDelegate {
// a crash.
test_result.status = TestResult::TEST_TIMEOUT;
}
+ } else if (test_result.status == TestResult::TEST_SUCCESS ||
+ test_result.status == TestResult::TEST_FAILURE) {
+ // We run multiple tests in a batch with a timeout applied
+ // to the entire batch. It is possible that with other tests
+ // running quickly some tests take longer than the per-test timeout.
+ // For consistent handling of tests independent of order and other
+ // factors, mark them as timing out.
+ if (test_result.elapsed_time >
+ TestTimeouts::test_launcher_timeout()) {
+ test_result.status = TestResult::TEST_TIMEOUT;
+ }
}
PrintTestOutputSnippetOnFailure(test_result, output);
tests[i].callback.Run(test_result);
« no previous file with comments | « base/test/test_timeouts.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698