-
Notifications
You must be signed in to change notification settings - Fork 388
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
Cypress freezes in Docker when running in Firefox #502
Comments
Same behaviour here. Only seen in firefox. Not working in 7.1.0 or later (just tested 7.3.0). Not sure about 7.0.1. Latest working revision is 7.0.0. Nothing random for me. Env: Test case: it('should login successfully', () => {
cy.get('[data-cy=account-button]').should('exist').click();
cy.get('input[name="username"]').clear().type(username);
cy.get('input[name="password"]').clear().type(password);
cy.intercept({
method: Cypress.env('endpoints').auth.sessions.method,
url: Cypress.env('endpoints').auth.sessions.url,
}).as('session');
cy.intercept({
method: Cypress.env('endpoints').auth.users.method,
url: Cypress.env('endpoints').auth.users.url,
}).as('users');
cy.get('#login').click();
cy.wait(['@session', '@users']).spread((authReqInt, userReqInt) => {
expect(authReqInt.response.statusCode).to.equal(200);
expect(authReqInt.response.body).to.not.be.null;
expect(userReqInt.response.statusCode).to.equal(200);
expect(userReqInt.response.body).to.not.be.null;
});
cy.get('[data-cy=welcome-message]').should('exist');
}); Note: The same code is executed in a previous test which PASS. Second time the code is executed Cypress hangs. Note2: Works without any issues when running cypress normally outside of docker. Suspected changes:
Log file (using cypress/included:7.3.0): |
Some more information:
Seems like the Firefox version used in cypress/included:7.0.1 compared to cypress/included:7.0.0 has been stepped backwards. Maybe an unintentional mistake that was done during the node14 uplift? A cypress/browsers build with Firefox version 86 also exists.
Not sure if the older Firefox version could cause the issue with hanging Cypress tests. The issue also seems to be related to shm.
This fix was also added in 7.0.1 and as far as I can see should only affect electron and chrome browsers... However, as seen in the log something called "electron-shared" is running and I'm not sure if --disable-dev-shm-usage could affect firefox. Also, running docker with increased shm-size=2gb seems to work in Firefox. That is:
With increased shm-size Cypress runs normally without freezing. |
Some more info. I have tested some different versions.
So the issue seems to be due to ff77 running in docker with default shm-size. I suggest updating cypress-io/cypress#350 (comment) mentions that there is no longer a need to specify |
I'm going to move this issue to the docker repo since it's specific to the docker images. |
@jenslycke Can you provide verbose logs with |
Since our current supported browser versions are 86 and above, i'm going to go ahead and close this issue. |
Hi, I was using Cypress 7.0.0 and the docker image cypress/included was working. After updating to 7.1.0 the docker container started to "freeze" on random tests. I tried to downgrade to 7.0.1 = didn't work, downgrading to 7.0.0 made it work again.
I say it "freezed" because there are no outputs to the console anymore and the container never finishes.
After running it with DEBUG=cypress:* the outputs stop at some point.
Every Minute or so it updates and shows "current & mean memory and CPU usage by process group" looking a little like this:
Then after waiting for like 10 Minutes I got this
After that the current memory and CPU usage is displayed again. Waiting didn't resolve anything. I have to manually stop the container.
I tested for about an hour and I intend to test more, but it seems to be happening with firefox pretty consistently for me. My test with electron was successful (meaning it finished as expected).
Since it will "freeze" on random tests I cannot really give any code to reproduce. Most tests that I saw it freeze didn't do anything crazy. Just some intercepts, visits, shoulds and maybe a type here and there. But I can give some code on how I start cypress in docker.
I basically create a docker image with the following code
Copying the files was done before I was in the project, but mounting the directory via docker run -v didn't have any impact.
After creating the image I run the container
docker run --name cy-e2e imagename --browser firefox --config video=false
The text was updated successfully, but these errors were encountered: