Commit aa368df8 authored by Tricia Crichton's avatar Tricia Crichton Committed by Commit Bot

[ChromeDriver] increase initial timeout for connect

On Windows 10, connecting to DevTools on users' systems is persistently
taking just over 2 seconds. This causes the first connection attempt to
fail, and increases the overall startup time to over 4 seconds. This cl
increases the first timeout to 4 seconds which allows the initial
connection to succeed more frequently. The overall time given to attempt
connecting to DevTools remains around 30 seconds.

Bug: chromedriver:3301
Change-Id: I29fcf45143d3daa714fa1ba2c0651e092234c63c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2029457Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Tricia Crichton <triciac@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736928}
parent d1aec337
......@@ -58,12 +58,13 @@ bool SyncWebSocketImpl::Core::Connect(const GURL& url) {
bool success = false;
base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
// Connect with retries. The retry timeout starts at 2 seconds, with
// Connect with retries. The retry timeout starts at 4 seconds, with
// exponential backoff, up to 16 seconds. The maximum total wait time is
// about 30 seconds. (Normally, a successful connection takes only a few
// milliseconds on Linux and Mac, but around a second on Windows.)
// milliseconds on Linux and Mac, but around 2 seconds for Windows 10.)
// See https://crbug.com/chromedriver/3301 for Windows 10 startup times
const int kMaxTimeout = 16;
for (int timeout = 2; timeout <= kMaxTimeout; timeout *= 2) {
for (int timeout = 4; timeout <= kMaxTimeout; timeout *= 2) {
context_getter_->GetNetworkTaskRunner()->PostTask(
FROM_HERE, base::BindOnce(&SyncWebSocketImpl::Core::ConnectOnIO, this,
url, &success, &event));
......
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