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.

Specs finish but cypress never exits - hangs stopping Xvfb

See original GitHub issue

Current behavior

I am trying to get my tests running in AWS CodeBuild and the tests are all running but then it just hangs at the end, when it tries to stop xvfb, due to X99 lock file not being found. It works as expected when I run it on my local Windows machine though.

This is what runs after the table of test results (AWS CodeBuild - Debian 9.13 - Chrome headless): Note: Other users also report it happening with an image FROM cypress/browsers:node16.14.0-chrome99-ff97

Logs with DEBUG=cypress:xvfb,xvfb

2022-05-27T04:55:20.925Z cypress:cli child event fired { event: 'exit', code: 1, signal: null }
2022-05-27T04:55:20.925Z cypress:cli Stopping Xvfb
2022-05-27T04:55:20.925Z xvfb restoring process.env.DISPLAY variable
2022-05-27T04:55:20.926Z xvfb lock filename /tmp/.X99-lock
2022-05-27T04:55:20.926Z xvfb lock file /tmp/.X99-lock
2022-05-27T04:55:20.936Z xvfb lock file /tmp/.X99-lock not found when stopping

Then it hangs.

It never gets to this point: cypress:cli child event fired { event: 'close', code: 2, signal: null }

Desired behavior

Exit when the tests are finished.

Test code to reproduce

It’s running like this:

set -e -o pipefail
cypress run --browser chrome 2>&1 | tee "cypress/logs/log.txt"
exit $?

Note: I have also tried using electron and the same thing happens.

Cypress Version

9.7.0 Also tested 9.5.1, 9.4.1, 9.3.1, 9.2.1, 8.7.0, 8.6.0, 8.5.0 - It is happening with all those.

Other

Here is the log output with DEBUG=cypress:xvfb,xvfb, minus the build and test parts where nothing of interest happened:

Build process setup...

Installing source NPM dependencies...


> my-project@1.0.0 cy:ci
> start-server-and-test start http-get://localhost:4200 cy:run-ci

1: starting server using command "npm run nonprod"
and when url "[ 'http-get://localhost:4200' ]" is responding with HTTP status code 200
WAIT_ON_INTERVAL is set to 5000
WAIT_ON_TIMEOUT is set to 900000
running tests using command "npm run cy:run-ci"

Application build process...

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Running Cypress E2E tests and logging output to file...

It looks like this is your first time using Cypress: 9.7.0

[STARTED] Task without title.
2022-05-27T07:58:00.990Z xvfb lock filename /tmp/.X99-lock
2022-05-27T07:58:00.990Z xvfb lock filename /tmp/.X99-lock
2022-05-27T07:58:00.990Z xvfb setting DISPLAY :99
2022-05-27T07:58:00.992Z xvfb all Xvfb arguments [ ':99', '-screen', '0', '1280x1024x24' ]
2022-05-27T07:58:01.000Z xvfb checking if started by looking for the lock file /tmp/.X99-lock
2022-05-27T07:58:01.011Z xvfb checking if started by looking for the lock file /tmp/.X99-lock
2022-05-27T07:58:01.021Z xvfb checking if started by looking for the lock file /tmp/.X99-lock
2022-05-27T07:58:01.031Z xvfb checking if started by looking for the lock file /tmp/.X99-lock
2022-05-27T07:58:01.042Z xvfb checking if started by looking for the lock file /tmp/.X99-lock
2022-05-27T07:58:01.042Z xvfb lock file /tmp/.X99-lock found after 40 ms

✔ Compiled successfully.
2022-05-27T07:58:02.898Z xvfb restoring process.env.DISPLAY variable
2022-05-27T07:58:02.898Z xvfb lock filename /tmp/.X99-lock
2022-05-27T07:58:02.898Z xvfb lock file /tmp/.X99-lock
2022-05-27T07:58:02.929Z xvfb lock file /tmp/.X99-lock not found when stopping
[SUCCESS] Task without title.

Opening Cypress...
2022-05-27T07:58:02.933Z xvfb lock filename /tmp/.X99-lock
2022-05-27T07:58:02.933Z xvfb setting DISPLAY :99
2022-05-27T07:58:02.933Z xvfb all Xvfb arguments [ ':99', '-screen', '0', '1280x1024x24' ]
2022-05-27T07:58:02.936Z xvfb checking if started by looking for the lock file /tmp/.X99-lock
2022-05-27T07:58:02.947Z xvfb checking if started by looking for the lock file /tmp/.X99-lock
2022-05-27T07:58:02.947Z xvfb lock file /tmp/.X99-lock found after 10 ms
Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"
[915:0527/075804.596661:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[915:0527/075804.605980:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

tput: No value for $TERM and no -T specified
================================================================================

  (Run Starting)

                                                                                                    
... Tests run ...

tput: No value for $TERM and no -T specified
================================================================================

  (Run Finished)

... Tests results table ...

2022-05-27T07:59:28.421Z xvfb restoring process.env.DISPLAY variable
2022-05-27T07:59:28.422Z xvfb lock filename /tmp/.X99-lock
2022-05-27T07:59:28.422Z xvfb lock file /tmp/.X99-lock
2022-05-27T07:59:28.432Z xvfb lock file /tmp/.X99-lock not found when stopping

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:27

github_iconTop GitHub Comments

1reaction
roobycommented, Jun 8, 2022

@ceelian That error “Could not find a Cypress configuration file.” doesn’t seem like the same error this issue is about.

0reactions
h4de5commented, Dec 28, 2022

I just want to point out, that this still seems to be a problem.

running cypress in headless mode (successfully since months). it stopped working somewhen around Dec. 22 - till now I do not have any idea what has been changed, but the issue seems to similar to the one described here:

  cypress:server:cypress from argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--run-project', 'apps/dashboard-e2e', '--config', '{"baseUrl":"https://dashboard:1234/"}', '--config-file', 'cypress.config.ts', '--env', '{"tsConfig":"/tmp/npm/apps/dashboard-e2e/tsconfig.e2e.json"}', '--output-path', '/tmp/tmp-5802-kn4MqI02zz6Z', '--record', 'false', '--testing-type', 'e2e', '--cwd', '/tmp/npm', '--userNodePath', '/usr/bin/node', '--userNodeVersion', '16.18.0' ] got options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, runProject: 'apps/dashboard-e2e', config: { e2e: { baseUrl: 'https://dashboard:1234/' }, env: { tsConfig: '/tmp/npm/apps/dashboard-e2e/tsconfig.e2e.json' } }, configFile: 'cypress.config.ts', outputPath: '/tmp/tmp-5802-kn4MqI02zz6Z', record: false, testingType: 'e2e', cwd: '/tmp/npm', userNodePath: '/usr/bin/node', userNodeVersion: '16.18.0', invokedFromCli: true, projectRoot: '/tmp/npm/apps/dashboard-e2e' } +11ms
  cypress:server:cypress scaling electron app in headless mode +0ms
  cypress:cli child event fired { event: 'exit', code: null, signal: 'SIGILL' } +1s
  cypress:cli detecting arch { osPlatform: 'linux', osArch: 'x64' } +1s
  cypress:cli arm uname -m result: { stdout: 'x86_64' }  +14ms
  cypress:cli child event fired { event: 'close', code: null, signal: 'SIGILL' } +16ms
  cypress:cli Stopping Xvfb +1s
  xvfb restoring process.env.DISPLAY variable +1s
  xvfb lock filename /tmp/.X99-lock +0ms
  xvfb lock file /tmp/.X99-lock +0ms
  xvfb lock file /tmp/.X99-lock not found when stopping +12ms
The Test Runner unexpectedly exited via a exit event with signal SIGILL

ng version

Angular CLI: 14.2.1
Node: 16.18.0
Package Manager: npm 7.24.2 
OS: linux x64

Angular: 14.2.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.1
@angular-devkit/build-angular   14.2.1
@angular-devkit/core            14.2.1
@angular-devkit/schematics      14.2.1
@angular/cli                    14.2.1
@angular/flex-layout            14.0.0-beta.40
@schematics/angular             14.2.1
ng-packagr                      14.2.0
rxjs                            7.5.7
typescript                      4.7.4
webpack                         5.75.0

npx nx --version

14.6.1

cypress version

Cypress package version: 10.6.0
Cypress binary version: 10.6.0
Electron version: 19.0.8
Bundled Node version: 16.14.2

for some reason beyond my understanding, it does work correctly when I start the ng command directly:

ng e2e dashboard-e2e --configuration production

works, tests and runs through just fine.

but if I start it prefixed with npx (or run the npm script for that very same command):

npx ng e2e dashboard-e2e --configuration production

it results in the error above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Cypress Documentation
If you're having an issue during installation of Cypress, try removing the contents of the Cypress cache. This will clear out all installed...
Read more >
Continuous Integration - cypress - w3resource
Whenever you boot your web server, it will run as long as there is a long running process that will never exit. This...
Read more >
Cypress never get past loading screen on Ubuntu
The cypress window opens but the spinner stays up and doesn't load ... own Xvfb NOTE: if the X11 server is NOT working,...
Read more >
cypress-io/cypress - Gitter
I run all my tests in 1 of 3 typical environments - but each will end by going ... //fail -> Cypress stops/finishes...
Read more >
Cypress Tips and Tricks - Gleb Bahmutov
Using a single cypress/integration/spec.js file to test a large web ... out retrying: Expected to find content: 'Join Us' but never did.",
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