-
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
Running cypress in headless mode should not use xvfb #16505
Comments
I believe the fix for this bug can be done within Line 60 in 56234e5
If the I would love to make a PR to fix this bug, but I'd like a little input from the maintainers as to the shape of the fix they are most comfortable with. |
@mrmeku that sounds like the right path. Does Electron still require X to run though? |
That's debatable. Chrome and chromium no longer need XVFB to run any more (see https://developers.google.com/web/updates/2017/04/headless-chrome) Electron's docs, on the other hand, makes the opposite claim (https://www.electronjs.org/docs/tutorial/testing-on-headless-ci) I suspect that the electron docs are merely out of date. Electron would need to be launched using the |
Running electron with the |
I did some experimenting with You could interact with electron via a helper file Anyway, the change is definitely slightly more involved that I had hoped since electron itself doesn't expose the same display server less headless mode that chromium does. |
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
We've run into this all of a sudden over the past couple of days (combo of this, cypress-io/xvfb#98, and cypress-io/cypress-docker-images#54). |
I'll keep hacking on my PR, I just got side tracked |
Happy to help test any changes if I can |
For now it seems like the |
Would also love to resolve this, I haven't contributed much, but this would also help support people trying to utilise cypress on heroku ci here. |
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
Co-authored-by: Ben Alman <[email protected]>
The code for this is done in cypress-io/cypress#16537, but has yet to be released. |
@jennifer-shehane @flotwig Would it be possible for someone to build a cypress binary for linux now that this change has been merged so I can test out the changes in my own projects to better exercise edge cases? |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
Currently, when I use cypress in headless mode via
cypress run
, xvfb is still invoked. Consequently, sometimes this can make my cypress tests error out due to an error.For example:
Cypress: Fatal IO error 11 (Resource temporarily unavailable) on X server :105.
Desired behavior
When running in headless mode, there is no need to spawn xvfb at all. This should only be done when using
cypress run
to run a browser in headed mode.Versions
All versions of cypress up to 7.3.0
The text was updated successfully, but these errors were encountered: