-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: hanging on basic auth requests in chromium browsers #27781
Conversation
6 flaky tests on run #50923 ↗︎
Details:
cypress/cypress.cy.js • 3 flaky tests • 5x-driver-electron
project-setup.cy.ts • 1 flaky test • launchpad-e2e
scaffold-component-testing.cy.ts • 2 flaky tests • launchpad-e2eReview all test suite changes for PR #27781 ↗︎ |
packages/socket/lib/browser.ts
Outdated
declare global { | ||
interface Window { | ||
cypressSockets: {[key: string]: CDPBrowserSocket} | ||
} | ||
} | ||
|
||
window.cypressSockets ||= {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need to add sockets to window for this fix? Is it for testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some doc to explain this a little better: 27b44ed
(#27781)
} | ||
|
||
return sockets[fullNamespace] | ||
window.cypressSockets[fullNamespace].connect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does connect do that we weren't doing before and why does it fix the hang?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some doc to explain this a little better: 27b44ed
(#27781)
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
Fixes a regression in
13.0.0
where tests using Basic Authorization can sometimes hang indefinitely on chromium browsers. This is caused because our assets are loaded twice when we have basic auth set on the base url. It is unclear why this is happening, but this has been happening since at least 12.0.0 it just didn't cause a problem until we started relying on a top level local variable for a cache of CDP sockets. The fix for this is to set the cache on window instead. This is not ideal, and we should investigate why this behavior is happening, but it is worth getting a fix out there for now so that we don't hang in this scenario.Steps to test
The new system test tests this scenario.
How has the user experience changed?
Tests will no longer hang
PR Tasks
cypress-documentation
?type definitions
?