question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XVFB issues when running two CI instances in parallel

See original GitHub issue

Is 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:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cameronc56commented, Mar 16, 2018

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.

1reaction
brian-manncommented, Mar 7, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found