-
Notifications
You must be signed in to change notification settings - Fork 383
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
XVFB timed out #54
Comments
Having the same issue when I run my docker-compose setup.
my Cypress docker file:
Also tried |
let's debug this problem
We have this problem occasionally on Travis CI but not on Circle for example, so we strongly think this is due to some bugs in containers not with the logic or time outs |
@bahmutov Thanks for your hints. Gonna check some of them out. I'm using a setup similar to here as I need to run a docker-compose setup on CircleCI. Basically I'm having an Angular app that's being booted and the Cypress container then runs the tests against that. Gonna check some of your debugging tips. locally on my machine it works. On CircleCI however I get the error 🤔
|
hmm, weird, but hard for me to recreate, a complete repro would be ideal. Does this happen every time? |
yes. I'll try to create a small sample repo and share it on GitHub |
@bahmutov I have a repro repository here: https://github.com/juristr/nx-cypress-ci-setup I can also add you (or anyone else) as a collaborator if that makes it easier to debug the issue. Locally it works just fine, when executed on CircleCI I get the error as seen here: https://circleci.com/gh/juristr/nx-cypress-ci-setup/3 Let me know if I can help |
@juristr I did not have time to debug the issue, but take a look at https://github.com/cypress-io/xvfb - this is the XVFB module we use to try to start the server (see #54 (comment)) Could you debug this problem in Circle by rerunning the job with SSH and maybe even editing the code in |
Oh alright, didn't know I can debug CircleCI via SSH. thx, will let you know 👍 |
I spent some time removing as many variables as I could to fix this problem, and it appears that running selenium alongside your other docker instances can cause this issue to appear. |
I ran into the same problem. After removing |
The problem is that when running in host mode, the X server port can be shared across cypress instances, the host machine itself, or something else (selenium). To fix we should use a nonstandard port for the xvfb instance within the container. You can also find the original X server and kill it first (in my case, Circle CI machine executor image has one.) These issues are connected |
@bahmutov Any updates here? |
@tylergets would you like to implement a detection for XVFB running already (probably in https://github.com/cypress-io/xvfb) and maybe a fix? |
Hi all. I've raised PR cypress-io/cypress#5035 containing the workaround we've used in my team for this issue. We've exposed an environment variable hook to allow us to control the XVFB port used, thereby allowing us to ensure that each of the containers participating in our parallel Cypress run does so using a different port number. While this doesn't address the underlying issue in the way that @bahmutov's suggestion would, it may at least help others work around this problem by giving them control of the XVFB port used until such time as that fix can be implemented. |
we have released Cypress v3.5.0 with a timeout of 30 seconds, I hope it helps. |
I was having the same issue, and what fixed it was adding: environment:
- DISPLAY to the cypress service in docker-compose. |
@davidedwards88 The PR link just leads back to this page. Was it merged, or do you have a copy somewhere? |
@thomasactia Apologies, I hadn't realised I'd included an incorrect link in my comment. I've been able to find the PR I should have referenced, which can be found at cypress-io/cypress#5035 (I've now updated my original comment also). As per the comments in that PR, unfortunately it went un-merged as I did not have time to address the feedback given. |
I'm running into this on the newest Cypress version ( |
I'm seeing this with Cypress version 6.6.0 and 6.4.0, using |
@dalgarno's solution worked for me, ie:
So full config for docker-compose for cypress is something like:
|
I have a temporary solution to solve Check xvfb port and generate cypress-xvfb lock file before running cypress prepare_xvfb () {
# delete all cypress-xvfb lock file
[ -f /tmp/.X*-lock ] && rm -f /tmp/.X*-lock
local display_num=99
local loop=true
while [ $loop == 'true' ]
do
# xvfb port
if [ $display_num -ge 100 ]; then
local xvfb_port="6$display_num"
else
local xvfb_port="60$display_num"
fi
# generate cypress-xvfb lock file
nc -z 127.0.0.1 "$xvfb_port" || local occupied=false
if [[ "$occupied" == "false" ]]; then
local loop=false
else
echo "[ Info ] xvfb display number :${display_num} was occupied. Check next"
echo "<my project> placeholder" > "/tmp/.X${display_num}-lock"
let display_num++
fi
done
echo "[ Info ] xvfb will use display :${display_num}."
}
|
I hit this as well, because we were running Selenium tests on the the Circle CI server as well as Cypress tests, and by the time we ran the Cypress tests we had already started Simply killing |
We are seening it recently in CI with GHA large runners.. 😕 |
Do you have details about which Cypress Docker image you are using, which version of Cypress and what your host environment is? Could you provide up-to-date logs? |
Closing due to inactivity. |
Hey,
I am trying to setup test environment which can be run on CircleCI. Locally, everything works fine, however, when tried to tied up everything and run it on CI environment I am getting following problem:
Any idea how to solve this? Docker setup is quite straightforward, I've got three nodes apps running in parallel + mongodb + cypress in image:
Cypress Dockerfile:
Cypress part in docker-compose:
And I am firing tests by running
docker-compose -f docker-compose.e2e.yml run cypress ./node_modules/.bin/cypress run
. As I said, locally it's fine, but CI environment fails with error shared above.I've also tried another solution - I wanted to use cypress node 10 image as base image for CircleCI and then run tests without docker, however, I need to run my apps from docker-compose and cypress image does not provide sudo and docker-compose as well.
The text was updated successfully, but these errors were encountered: