XVFB issues when running two CI instances in parallel
See original GitHub issueIs this a Feature or Bug?
Bug
Current behavior:
When running two test instances within the GitLab CI in parallel (one dev and one prod) with the same cypress config (expect of the port) one of both jobs throws the following error:
Your system is missing the dependency: XVFB
Install XVFB and run Cypress again.
Read our documentation on dependencies for more information:
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
Caught error trying to run XVFB: "Your system is missing the dependency: XVFB
Install XVFB and run Cypress again.
Read our documentation on dependencies for more information:
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
Error: Could not start Xvfb.
----------
The jobs run headless and all requirements for the core system running in CI are installed. When I restart the job after the successful one was finished, everything works fine. I googled a bit and found this one: https://stackoverflow.com/questions/30332137/xvfb-run-unreliable-when-multiple-instances-invoked-in-parallel. Maybe this could be a hint what goes wrong?
How to reproduce:
Start two CI jobs using cypress run
in parallel
- Operating System: ArchLinux with Kernel 4.15.7-1
- Cypress Version: 2.1.0
Thanks Sebastian
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
Top Results From Across the Web
xvfb-run unreliable when multiple instances invoked in parallel
Try passing a unique --server-num argument to each instance of xvfb-run , rather than relying on -a to handle potential races correctly. –...
Read more >38 How To Run Your Tests Headlessly with Xvfb
If you're running tests headlessly across different builds at the same time (e.g., in parallel) on your CI server, then jobs will start...
Read more >Running GUI tests in parallel on a single host
This article demonstrates how to setup running Squish tests in parallel on a single agent host using TeamCity with Squish plugin installed.
Read more >cypress-kraken - npm
When running several Cypress instances in parallel, the spawning of multiple X11 servers at once can cause problems for some of them. In...
Read more >Xvfb - Jenkins Plugins
Use I'm running this job in parallel on same node when running multiple slaves ... see if the issue you're experiencing is due...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve been experiencing similar failures when cypess is trying to detect a free port, i had --net=host on my docker image, and my jenkins host would intermittently also use port 6099 for some process, causing sporadic failures.
You likely want to split up running Cypress across two different instances - not the same instance. It is possible to do as you’re doing - but you will be maxing out the CPU and likely the RAM with just a single instance running… with two they will most definitely affect one another.
I looked at the link - and although we don’t use
xvfb-run
, the same scenario is likely happening. We do use lockfiles but its possible there is a race condition if you’re spawning them at the same time.