OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/test/launcher/test_launcher.h" | 5 #include "base/test/launcher/test_launcher.h" |
6 | 6 |
7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 watchdog_timer_.Reset(); | 481 watchdog_timer_.Reset(); |
482 | 482 |
483 // Do not waste time on timeouts. We include tests with unknown results here | 483 // Do not waste time on timeouts. We include tests with unknown results here |
484 // because sometimes (e.g. hang in between unit tests) that's how a timeout | 484 // because sometimes (e.g. hang in between unit tests) that's how a timeout |
485 // gets reported. | 485 // gets reported. |
486 if (result.status == TestResult::TEST_TIMEOUT || | 486 if (result.status == TestResult::TEST_TIMEOUT || |
487 result.status == TestResult::TEST_UNKNOWN) { | 487 result.status == TestResult::TEST_UNKNOWN) { |
488 test_broken_count_++; | 488 test_broken_count_++; |
489 } | 489 } |
490 size_t broken_threshold = | 490 size_t broken_threshold = |
491 std::max(static_cast<size_t>(10), test_started_count_ / 10); | 491 std::max(static_cast<size_t>(20), test_started_count_ / 10); |
492 if (test_broken_count_ >= broken_threshold) { | 492 if (test_broken_count_ >= broken_threshold) { |
493 fprintf(stdout, "Too many badly broken tests (%" PRIuS "), exiting now.\n", | 493 fprintf(stdout, "Too many badly broken tests (%" PRIuS "), exiting now.\n", |
494 test_broken_count_); | 494 test_broken_count_); |
495 fflush(stdout); | 495 fflush(stdout); |
496 | 496 |
497 #if defined(OS_POSIX) | 497 #if defined(OS_POSIX) |
498 KillSpawnedTestProcesses(); | 498 KillSpawnedTestProcesses(); |
499 #endif // defined(OS_POSIX) | 499 #endif // defined(OS_POSIX) |
500 | 500 |
501 results_tracker_.AddGlobalTag("BROKEN_TEST_EARLY_EXIT"); | 501 results_tracker_.AddGlobalTag("BROKEN_TEST_EARLY_EXIT"); |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 | 1069 |
1070 g_live_processes.Get().erase(process_handle); | 1070 g_live_processes.Get().erase(process_handle); |
1071 } | 1071 } |
1072 | 1072 |
1073 base::CloseProcessHandle(process_handle); | 1073 base::CloseProcessHandle(process_handle); |
1074 | 1074 |
1075 return exit_code; | 1075 return exit_code; |
1076 } | 1076 } |
1077 | 1077 |
1078 } // namespace base | 1078 } // namespace base |
OLD | NEW |