Skip to content

Commit

Permalink
add success message
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Jan 19, 2021
1 parent 7f41984 commit 7a3ace5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/server/__snapshots__/5_cdp_spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ exports['e2e cdp / with stdio transport / falls back to connecting via tcp when
Running: spec.ts (1 of 1)
Warning: Cypress failed to connect to Chrome via stdio after 1 second. Falling back to TCP...
Connecting to Chrome via TCP was successful, continuing with tests.
passes
Expand Down
8 changes: 6 additions & 2 deletions packages/server/lib/browsers/chrome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,14 @@ const _connectToChromeRemoteInterface = function (browser, process, port, onErro

return CriClient.create({ process }, onError)
.timeout(stdioTimeoutMs)
.catch(Bluebird.TimeoutError, () => {
.catch(Bluebird.TimeoutError, async () => {
errors.warning('CDP_STDIO_TIMEOUT', browser.displayName, stdioTimeoutMs)

return connectTcp()
const client = await connectTcp()

errors.warning('CDP_FALLBACK_SUCCEEDED', browser.displayName)

return client
})
}

Expand Down
2 changes: 2 additions & 0 deletions packages/server/lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,8 @@ const getMsgByType = function (type, arg1 = {}, arg2, arg3) {
return 'The connection between Cypress and Chrome has unexpectedly ended. Please restart the browser.'
case 'CDP_STDIO_TIMEOUT':
return `Warning: Cypress failed to connect to ${arg1} via stdio after ${humanTime.long(arg2)}. Falling back to TCP...`
case 'CDP_FALLBACK_SUCCEEDED':
return `Connecting to ${arg1} via TCP was successful, continuing with tests.`
case 'CDP_RETRYING_CONNECTION':
return `Failed to connect to Chrome, retrying in 1 second (attempt ${chalk.yellow(arg1)}/62)`
case 'DEPRECATED_BEFORE_BROWSER_LAUNCH_ARGS':
Expand Down

0 comments on commit 7a3ace5

Please sign in to comment.