Commit 354a8059 authored by Yuke Liao's avatar Yuke Liao Committed by Commit Bot

[code coverage] Increase timeouts of browser_tests for coverage build

The coverage build is about 10x slower than regular build when running
browser_tests, and this CL increases the timeouts accordingly.

Bug: 937521
Change-Id: I5939648142f29fbd9fe36625d661cc70ff6019e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504153
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638433}
parent 861b8954
...@@ -20,6 +20,7 @@ static_library("test_config") { ...@@ -20,6 +20,7 @@ static_library("test_config") {
] ]
deps = [ deps = [
"//base", "//base",
"//base:clang_coverage_buildflags",
] ]
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <algorithm> #include <algorithm>
#include "base/clang_coverage_buildflags.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/debug/debugger.h" #include "base/debug/debugger.h"
#include "base/logging.h" #include "base/logging.h"
...@@ -55,6 +56,9 @@ void InitializeTimeout(const char* switch_name, int min_value, int* value) { ...@@ -55,6 +56,9 @@ void InitializeTimeout(const char* switch_name, int min_value, int* value) {
constexpr int kTimeoutMultiplier = 3; constexpr int kTimeoutMultiplier = 3;
#elif defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) #elif defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER)
constexpr int kTimeoutMultiplier = 2; constexpr int kTimeoutMultiplier = 2;
#elif BUILDFLAG(CLANG_COVERAGE)
// On coverage build, tests run 3x slower.
constexpr int kTimeoutMultiplier = 3;
#else #else
constexpr int kTimeoutMultiplier = 1; constexpr int kTimeoutMultiplier = 1;
#endif #endif
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "content/browser/browser_process_sub_thread.h" #include "content/browser/browser_process_sub_thread.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/clang_coverage_buildflags.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/debug/alias.h" #include "base/debug/alias.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
...@@ -193,7 +194,13 @@ void BrowserProcessSubThread::IOThreadCleanUp() { ...@@ -193,7 +194,13 @@ void BrowserProcessSubThread::IOThreadCleanUp() {
service_manager::SANDBOX_TYPE_NETWORK) { service_manager::SANDBOX_TYPE_NETWORK) {
// This ensures that cookies and cache are flushed to disk on shutdown. // This ensures that cookies and cache are flushed to disk on shutdown.
// https://crbug.com/841001 // https://crbug.com/841001
#if BUILDFLAG(CLANG_COVERAGE)
// On coverage build, browser_tests runs 10x slower.
const int kMaxSecondsToWaitForNetworkProcess = 100;
#else
const int kMaxSecondsToWaitForNetworkProcess = 10; const int kMaxSecondsToWaitForNetworkProcess = 10;
#endif
ChildProcessHostImpl* child_process = ChildProcessHostImpl* child_process =
static_cast<ChildProcessHostImpl*>(it.GetHost()); static_cast<ChildProcessHostImpl*>(it.GetHost());
auto& process = child_process->peer_process(); auto& process = child_process->peer_process();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment