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

Unified Diff: base/test/launcher/test_launcher.cc

Issue 469533002: Change gtest launcher to run in parallel and retry failures by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update w/ review feedback Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/launcher/test_launcher.cc
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index e6c1507250d14eb90ac80b770e75e0060f8f269e..697c8c72144fcb6f5c855a3bb5f5be9ed72d751c 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -336,20 +336,6 @@ TestLauncher::TestLauncher(TestLauncherDelegate* launcher_delegate,
this,
&TestLauncher::OnOutputTimeout),
parallel_jobs_(parallel_jobs) {
- if (BotModeEnabled()) {
- fprintf(stdout,
- "Enabling defaults optimized for continuous integration bots.\n");
- fflush(stdout);
-
- // Enable test retries by default for bots. This can be still overridden
- // from command line using --test-launcher-retry-limit flag.
- retry_limit_ = 3;
- } else {
- // Default to serial test execution if not running on a bot. This makes it
- // possible to disable stdio redirection and can still be overridden with
- // --test-launcher-jobs flag.
- parallel_jobs_ = 1;
- }
}
TestLauncher::~TestLauncher() {
@@ -650,6 +636,9 @@ bool TestLauncher::Init() {
}
retry_limit_ = retry_limit;
+ } else if (!CommandLine::ForCurrentProcess()->HasSwitch(kGTestFilterFlag)) {
+ // Retry failures 3 times by default if we are running all of the tests.
+ retry_limit_ = 3;
}
if (CommandLine::ForCurrentProcess()->HasSwitch(
@@ -663,7 +652,12 @@ bool TestLauncher::Init() {
}
parallel_jobs_ = jobs;
+ } else if (CommandLine::ForCurrentProcess()->HasSwitch(kGTestFilterFlag)) {
+ // Do not run jobs in parallel by default if we are running a subset of
+ // the tests.
+ parallel_jobs_ = 1;
}
+
fprintf(stdout, "Using %" PRIuS " parallel jobs.\n", parallel_jobs_);
fflush(stdout);
worker_pool_owner_.reset(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698