Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use stdio for CDP instead of TCP #14348

Merged
merged 11 commits into from
Jan 19, 2021
Merged

fix: use stdio for CDP instead of TCP #14348

merged 11 commits into from
Jan 19, 2021

Conversation

flotwig
Copy link
Contributor

@flotwig flotwig commented Dec 29, 2020

User facing changelog

  • Updated the CDP connection to attempt to use the stdio transport first with Chrome 72 and above, before falling back to using TCP. This should remediate issues causing sporadic 'Cypress failed to make a connection to the Chrome DevTools Protocol after retrying' errors.

Additional details

How has the user experience changed?

  • this warning:
    image
  • CYPRESS_CDP_TARGET_TIMEOUT (undocumented, like CYPRESS_REMOTE_DEBUGGING_PORT, since it's just for testing purposes)

PR Tasks

  • Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?
  • [na] Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 29, 2020

Thanks for taking the time to open a PR!

@jennifer-shehane
Copy link
Member

@flotwig There's this newly opened issue with this error happening in Firefox. Would this solution also fix that? #14272

@flotwig
Copy link
Contributor Author

flotwig commented Jan 4, 2021

@jennifer-shehane I don't think so, we'd need both Marionette and the Remote Protocol to be available over stdio, and I don't see config options for doing either. Currently the ports are set up like so:

defaultLaunchOptions.preferences['devtools.debugger.remote-port'] = foxdriverPort
defaultLaunchOptions.preferences['marionette.port'] = marionettePort

@cypress
Copy link

cypress bot commented Jan 11, 2021



Test summary

3961 0 52 1


Run details

Project cypress
Status Passed
Commit 7a3ace5
Started Jan 19, 2021 7:05 PM
Ended Jan 19, 2021 7:17 PM
Duration 12:00 💡
OS Linux Debian - 10.5
Browser Firefox 77

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@flotwig flotwig marked this pull request as ready for review January 11, 2021 22:11
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flotwig What's the purpose of showing this warning to the user? Can they do anything with this info? IMO, warning should only be displayed if there's an action to advise the user to take.

Warning: Cypress failed to connect to Chrome via stdio after 1 second. Falling back to TCP...

I think this should only display in DEBUG logs. People tend to open issues when if they see warnings, so if the warning will print and then continue on normally - I don't want people opening an issue about this, thinking something is broken.

If the warning is necessary to be shown for some reason to the user, I would prefer to have some sort of 'success' message afterwards to indicate that the connection continued successfully.

Warning: Cypress failed to connect to Chrome via stdio after 1 second. Falling back to TCP...
Connection to TCP successful, continuing with tests


I did not technically review anything else in this PR.

@jennifer-shehane jennifer-shehane dismissed their stale review January 19, 2021 16:37

Dismissing my previous review - expecting Zach to update to add a success msg after the warning.

pashidlos pushed a commit to pashidlos/cypress that referenced this pull request Jan 30, 2021
flotwig added a commit that referenced this pull request Mar 16, 2021
@flotwig flotwig deleted the cdp-pipe branch January 24, 2022 18:14
tbiethman added a commit that referenced this pull request Aug 25, 2022
… tests (#23522)

* detect playwright-webkit browser

* fix: use stdio for CDP instead of TCP (#14348)

* wip: begin launchin webkit

* run mode works w webkit in 10.0

* reset previous cdp changes

* run driver webkit tests

* always detect webkit in non-prod

* fix version detection

* actually run new job

* cleanup

* fix run

* try caching pw binary

* npx install pw binary

* install-deps

* add experimentalSessionAndOrigin wk tests

* wk experimentalSessionAndOrigin tests

* browser icon

* fix some tests

* reset browsers.ts change

* fix more tests

* fix even more tests, skip driver CI for now

* comma

* fix server-unit-test

* fix websockets_spec

* refactor wkautomation to initialize self from static async method

* fix(proxy/prerequests): fix duplicate key behavior, fallthrough

* Apply suggestions from code review

Co-authored-by: Blue F <blue@cypress.io>

* simpler name for StackMap

* fix proxy-logging spec, some xhr specs

* fix last xhr test

* update testConfigOverrides

* skip webcam.cy.js

* reenable driver tests

* ci?

* Suggestions from code review

* skip remaining failures which won't be fixed here

* fix/skip a couple tests

* fix tests

* skip crashy specs

* skip hidden suites

* Scoping down range of skipped type tests

* Scoping down click test skips

* Updating webkit contenteditable selection handling and associated test

* Adding additional mouse event filtering when disabled. Validated by opening playwright-webkit outside of cypress and validating logged events when enabled/disabled.

* Updating click 'mouseout coords' tests to account for default style changes

* Updating a few more click 'mouse state' tests

* Getting all click tests passing with no webkit skips. Fixing _most_ type tests, selection focus is troublesome.

* Updating cross-origin type action test

* Tweaking coords for CI rendering

* Adding workaround for webkit default input selection.

* Webkit -> WebKit

* Adding logic and test for handling capture-phase focus event selections

* Type errors tests now passing

* Adding a couple more WebKit keyboard/mouse tweaks

* Couple more tweaks for special_chars tests.

* Updating contenteditable beforeinput event tests

* Making WebKit checks more consistent

* Don't expose webkit in public types

* Adding comments and doing a little cleanup

* PR updates

* Simplifying workaround for webkit focus selection

* Removing unnecessary test

* Revert "Removing unnecessary test"

This reverts commit 2c52293.

* Revert "Simplifying workaround for webkit focus selection"

This reverts commit 47d1155.

* Removing comment that is no longer applicable

* Simplifying selection logic that is now functional for all supported browsers

Co-authored-by: Zach Bloomquist <git@chary.us>
Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Blue F <blue@cypress.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants