cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.85k stars 3.17k forks source link

Requests from Firefox Extension always delayed 500ms due to timeout in proxy server #29520

Open tylerccarson opened 5 months ago

tylerccarson commented 5 months ago

Current behavior

There's an artificial 500ms delay to every HTTP request issued from the background page on a Firefox Extension. For whatever reason, this issue does not seem to come up for Chrome Extensions.

cypress:proxy:http:util:prerequests Never received pre-request or url without pre-request for request POST-http://localhost:8000/api/rest/vault/sync_down after waiting 500ms. Continuing without one. +546ms

Desired behavior

No response

Test code to reproduce

Repo to demonstrate: https://github.com/tylerccarson/cy-firefox-ext-prerequest-delay.

Start the local server npm run cypress:server, and then run Cypress in interactive mode in another process. You will see that the Chrome test passes, while if fails in Firefox.

Cypress Version

13.9.0

Node version

20.12.2

Operating System

macOS 14.5

Debug Logs

No response

Other

No response

jennifer-shehane commented 5 months ago

@tylerccarson Could you provide some information on how we could recreate this situation?

tylerccarson commented 5 months ago

@tylerccarson Could you provide some information on how we could recreate this situation?

@jennifer-shehane I've just uploaded a demo repo that demonstrates the failing case in Firefox and the passing case in Chrome. Please let me know how else I can assist if needed.

jennifer-shehane commented 5 months ago

@tylerccarson Thanks for the reproducible example. I do see this behavior when I run this.

eisenpony commented 1 week ago

I am seeing this randomly after Cypress is running for a short time. In my case, it occurs in Chrome running in WSL.

2024-10-04T21:38:47.738Z cypress:proxy:http:util:prerequests Never received pre-request or url without pre-request for request GET-http://localhost:5173/__cypress/src/src/... after waiting 2000ms. Continuing without one.

I'm also seeing this in my extension logs -- seems related, but these start immediately, not just after the server starts logging "Never received pre-request..." and responding slowly.

 cypress:driver:proxy-logging unmatched responseReceived event {requestId: '223490.1912', status: 200, headers: {…}} +42ms
 cypress:driver emitted: 'request:event' - with args: 'response:received' +42ms {requestId: '223490.1912', status: 200, headers: {…}}