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

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

Issue 102073012: GTTF: only print the message about skipping retries when it actually applies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 6 years, 11 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 b997d970ba7c9955516b5f045a7b369ed7c362a3..aec30b6ace80d4535b4b1941eafc0e5abcd5ff2e 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -504,49 +504,50 @@ void TestLauncher::OnTestFinished(const TestResult& result) {
exit(1);
}
- if (test_finished_count_ == test_started_count_) {
- if (!tests_to_retry_.empty()) {
- if (retry_count_ < retry_limit_ &&
- tests_to_retry_.size() < broken_threshold) {
- retry_count_++;
-
- std::vector<std::string> test_names(tests_to_retry_.begin(),
- tests_to_retry_.end());
-
- tests_to_retry_.clear();
-
- size_t retry_started_count =
- launcher_delegate_->RetryTests(this, test_names);
- if (retry_started_count == 0) {
- // Signal failure, but continue to run all requested test iterations.
- // With the summary of all iterations at the end this is a good
- // default.
- run_result_ = false;
-
- OnTestIterationFinished();
- } else {
- fprintf(stdout, "Retrying %" PRIuS " test%s (retry #%" PRIuS ")\n",
- retry_started_count,
- retry_started_count > 1 ? "s" : "",
- retry_count_);
- fflush(stdout);
-
- test_started_count_ += retry_started_count;
- }
- } else {
- fprintf(stdout,
- "Too many failing tests (%" PRIuS "), skipping retries.\n",
- tests_to_retry_.size());
- fflush(stdout);
+ if (test_finished_count_ != test_started_count_)
+ return;
- results_tracker_.AddGlobalTag("BROKEN_TEST_SKIPPED_RETRIES");
+ if (tests_to_retry_.empty() || retry_count_ >= retry_limit_) {
+ OnTestIterationFinished();
+ return;
+ }
- OnTestIterationFinished();
- }
- } else {
- OnTestIterationFinished();
- }
+ if (tests_to_retry_.size() >= broken_threshold) {
+ fprintf(stdout,
+ "Too many failing tests (%" PRIuS "), skipping retries.\n",
+ tests_to_retry_.size());
+ fflush(stdout);
+
+ results_tracker_.AddGlobalTag("BROKEN_TEST_SKIPPED_RETRIES");
+
+ OnTestIterationFinished();
+ return;
+ }
+
+ retry_count_++;
+
+ std::vector<std::string> test_names(tests_to_retry_.begin(),
+ tests_to_retry_.end());
+
+ tests_to_retry_.clear();
+
+ size_t retry_started_count = launcher_delegate_->RetryTests(this, test_names);
+ if (retry_started_count == 0) {
+ // Signal failure, but continue to run all requested test iterations.
+ // With the summary of all iterations at the end this is a good default.
+ run_result_ = false;
+
+ OnTestIterationFinished();
+ return;
}
+
+ fprintf(stdout, "Retrying %" PRIuS " test%s (retry #%" PRIuS ")\n",
+ retry_started_count,
+ retry_started_count > 1 ? "s" : "",
+ retry_count_);
+ fflush(stdout);
+
+ test_started_count_ += retry_started_count;
}
bool TestLauncher::Init() {
« 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