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

Remove usage of --remote-debugging-port, rely on Chrome-chosen port instead #16833

Closed
flotwig opened this issue Jun 7, 2021 · 6 comments
Closed
Labels
browser: chrome browser: firefox stale no activity on this issue for a long period topic: CDP connection Issue with connection to Chrome DevTools Protocol type: breaking change Requires a new major release version

Comments

@flotwig
Copy link
Contributor

flotwig commented Jun 7, 2021

Current behavior

Cypress launches Chrome with --remote-debugging-port=SOME OPEN PORT. Unfortunately, this creates a race condition, since the port that was open at the time of port detection may not be open once Chrome has finished launching and listening. Especially in CI where the TCP port namespace is shared between containers.

Desired behavior

Do not specify a port, instead, let Chrome choose an open port so this race condition cannot occur.

This will break a common pattern that users use in their plugins - snarfing the RDP port from --remote-debugging-port arg and then connecting to it via their plugin code to send commands. This is used in many community plugins, including https://github.com/flotwig/cypress-log-to-output , so we should consider it a breaking change.

As a result, this should not be added until we have another way to expose CDP to users.

Edit: Most likely this could also be applied to Firefox's CDP port.

Test code to reproduce

Versions

@flotwig flotwig added browser: chrome type: breaking change Requires a new major release version topic: CDP connection Issue with connection to Chrome DevTools Protocol labels Jun 7, 2021
@bahmutov
Copy link
Contributor

bahmutov commented Jun 10, 2021 via email

@flotwig
Copy link
Contributor Author

flotwig commented Jun 10, 2021

Do you think this will solve the leftover "Cypress failed to make a connection to the Chrome DevTools Protocol" errors?

This only fixes the race condition possibility.

#16620 kinda sounds like a duplicate of #16571, since from what I can gather it's happening every time. #15650 might be a duplicate as well, since it implies that it's happening every time. But since it's happening every time, none of these 3 are covered by this issue.

#5613 happens for a different reason too: #5613 (comment)

@jennifer-shehane
Copy link
Member

Yah I was going to try to clean up the duplicates today. Would be nice to fix those. 😢

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 17, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser: chrome browser: firefox stale no activity on this issue for a long period topic: CDP connection Issue with connection to Chrome DevTools Protocol type: breaking change Requires a new major release version
Projects
None yet
Development

No branches or pull requests

4 participants