-
Notifications
You must be signed in to change notification settings - Fork 358
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
Figure out how to run Firefox better #104
Comments
Although firefox works well locally, it fails to launch in the CI env. Seems to be related to cypress-io/github-action#104
Yeah, attempting to make a sample PWA that has FF under CI but I may throw in the towel for now, it seems to start but then will just hang endlessly. It could be related to previous hanging issues with Shadow DOM (this is an Ionic app). The tests will pass locally in FF, though. Since it's beta, it's not a huge deal to explain away. Tip for anyone who finds this, set |
@kamranayub Make sure to update to latest Cypress because we have been fixing the shadow dom hanging as we find them. Today, we're only aware of hanging when using |
I'm still investigating but it hangs on my window |
Edit: It works! See the end or read the info gathering.So what I am seeing is a little interesting. It appears that my tests are passing but then mid-way through a test suite, GitHub Actions does not get any more logging/output and there was a 12 minute gap until finally my job hit the wait limit. The video file for the test suite that "failed" (all the tests were passing in the logs at the point of failure) is 3MB and corrupt, I can't open it, but other video files I can. The output then just cuts off and times out: Notice at the very end, a gap of 12 minutes. This is why I think it hangs for some reason and describe("on larger screens", () => {
before(() => {
cy.visit("/");
});
it("should continue displaying marketing imagery", () => {
cy.viewport("macbook-15");
cy.get(".hero-image-col").should("be.visible");
});
}); The only thing I could possibly think of is that the viewport size is wider than whatever is running in CI natively? But that's a wild guess. 🤷♂️ For the 6 hour run, it hung until the 360 minute time limit hit. It stopped during my Notifications test suite so I thought it was due to a bug in my permissions plugin (which wasn't working in FF) so it was hanging on a native prompt.
But since I fixed that, the notifications suite works and now it's failing on the responsive design suite but there's nothing very special about it besides calling One other data point: when running locally, sometimes closing Firefox doesn't register properly to the test runner (it doesn't reset) and I have to click Run All Tests to reset it. Sometimes clicking Attempted fixes
Increasing Shared Memory SizeThe way to add this is next to the container options: jobs:
firefox:
runs-on: ubuntu-16.04
container:
image: cypress/browsers:node12.14.1-chrome83-ff77
options: --user 1001 --shm-size=2g
# ^------------------ Magic! With this fix, the tests pass now! |
Attempt to fix using: cypress-io/github-action#104 (comment)
Attempt to fix using: cypress-io/github-action#104 (comment)
For some reason, cypress does not detect firefox, which could be because you need to run as a non-root user, cfr: cypress-io/github-action#104
I was running into issues with a custom docker container for the job using I found a solution that I could imagine may very well break some other stuff haha, but it doesn't look like it's breaking any of my things I need to do anyway! For my usecase it seems a lot less intrusive and in case it is for others as well I just wanted to share. And that was simply to have jobs:
job-name:
env:
HOME: "" And it's important not just to do it for the cypress step because then in the install steps it seems like Cypress installs something in the home folders that it needs and it breaks Cypress, if you have it through the whole job like this though, it works perfectly :). When HOME is set to empty string Firefox allows you to run it as root nicely, and I can keep all the permissions to access my files in the container easily |
Thanks @emilgoldsmith! 🎉 This solved a similar issue that I've been struggling with for quite some time. |
@KleisKlasKluss and @emilgoldsmith I've been running into issues with a custom self-hosted runner (building the image and setting up the environment myself). What does setting "HOME" empty do for the run as user 1001? When I build the AMI image I only have 2 users (ec2-user and ssm-user) -- and the docker container gets layered in after (I think). Anyway I don't have a 1001 user when I'm running the install so I'm curious about how this maps to the environment and PATH. |
The original post for this issue says:
however this refers only to running Firefox in a Docker container provided by cypress-io/cypress-docker-images. When using a GitHub runner directly without a Docker container from cypress-io/cypress-docker-images there is no need to supply a user. Firefox was added to the GitHub runners in March 2020. The .github/workflows/example-firefox.yml demonstrates testing with Firefox without specifying
|
Got into this issue. But for a custom self-hosted runner got into this other issue : actions/checkout#956 (comment) bahmutov Preferred way solved it : |
Were you using a Docker container from https://github.com/cypress-io/cypress-docker-images when you applied
or did you have Firefox directly installed in your self-hosted runner? What operating system was your self-hosted runner? Ubuntu or something else? |
Yes using the docker image cypress/browsers:node16.16.0-chrome107-ff107 in a container action. Complexity for us is :
I hope this gives you some context. |
Thank you very much for describing your environment and situation!
|
Closing, as this topic belongs in the cypress-io/cypress-docker-images/issues/ list. README > Docker image recommends specifying container:
image: cypress/browsers:latest
options: --user 1001 and refers to cypress-io/cypress-docker-images for further information. |
--user 1001
to match the permissions GH sets when creating a home folder for the userPermissions on the home folder
It would be nice to run with any non-root user, for example our cypress-docker-images have
node
user with id 1000.PS: the
1001
user works but has group id of 0Preferred
The text was updated successfully, but these errors were encountered: