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

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

Issue 1469843005: Calculate broken tests threshold based on number of tests in binary, before applying filter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/launcher/test_launcher.h ('k') | 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 e4b5bdaacecc25d2ef85a6e489e659480a62dae6..b1a1a89ce82ccf3d387173fd271de596694ce016 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -452,6 +452,7 @@ TestLauncher::TestLauncher(TestLauncherDelegate* launcher_delegate,
total_shards_(1),
shard_index_(0),
cycles_(1),
+ test_found_count_(0),
test_started_count_(0),
test_finished_count_(0),
test_success_count_(0),
@@ -621,7 +622,7 @@ void TestLauncher::OnTestFinished(const TestResult& result) {
test_broken_count_++;
}
size_t broken_threshold =
- std::max(static_cast<size_t>(20), test_started_count_ / 10);
+ std::max(static_cast<size_t>(20), test_found_count_ / 10);
if (!force_run_broken_tests_ && test_broken_count_ >= broken_threshold) {
fprintf(stdout, "Too many badly broken tests (%" PRIuS "), exiting now.\n",
test_broken_count_);
@@ -927,6 +928,9 @@ void TestLauncher::RunTests() {
continue;
}
+ // Count tests in the binary, before we apply filter and sharding.
+ test_found_count_++;
+
// Skip the test that doesn't match the filter (if given).
if (!positive_test_filter_.empty()) {
bool found = false;
@@ -980,6 +984,7 @@ void TestLauncher::RunTestIteration() {
// Special value "-1" means "repeat indefinitely".
cycles_ = (cycles_ == -1) ? cycles_ : cycles_ - 1;
+ test_found_count_ = 0;
test_started_count_ = 0;
test_finished_count_ = 0;
test_success_count_ = 0;
« no previous file with comments | « base/test/launcher/test_launcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698