cypress: Cannot `cypress verify` - Hangs on Smoke Test on WSL2
Current behavior:
I have just installed version 4.4.0
of cypress and integrated it in to my project. I’m using using WSL Ubuntu and have install the suggested packages in the documentation.
After trying several fixes as well as reverting the version to earlier versions where I’m met with different issues.
After running DEBUG=cypress:* yarn run cypress open
it looks like it’s getting stuck on the smoke test time out
.
cypress:cli disabling Electron sandbox +57ms
cypress:cli running smoke test +1ms
cypress:cli using Cypress executable /home/<user>/.cache/Cypress/4.4.0/Cypress/Cypress +0ms
cypress:cli smoke test command: /home/<user>/.cache/Cypress/4.4.0/Cypress/Cypress --no-sandbox --smoke-test --ping=47 +0ms
cypress:cli smoke test timeout 30000 ms +0ms
⠼ Verifying Cypress can run /home/<user>/.cache/Cypress/4.4.0/Cypress
Desired behavior:
It should continue to verify and then open Cypress
If anybody could point me in the right direction that would be much appreciated
Versions
Cypress: 4.4.0 Windows 10 Ubuntu 18.04.4 LTS
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 7
- Comments: 32 (6 by maintainers)
@timharsch your solution worked for me on WSL2. I had a
DISPLAY
env variable set for VcXsrv, and after runningunset DISPLAY
the verification step completed w/o issues.Same here in WSL2 Ubuntu 20.04 LTS and Cypress 8.0.0
if DISPLAY env variable is set it fails but unsetting the variable by doing so is making it work :
unset DISPLAY
I am having similar problems, it just keeps on hanging on Window 10 - WSL version 1 - This is the debug output:
I was in a similar case (WSL 1 - Ubuntu 18 - Windows 10 - Cypress 4.4 or 4.5) and migrating to WSL 2 seems to fix the issue
Yeah, but the problem is that if you unset DISPLAY, you’re preventing Cypress from launching the GUI since it has no display to connect to.
After a lot of debugging, I found the solution, which is actually quite simple. Jenkins runs docker with a user mapping -u 996:994 This user does not exist in the docker image. When docker starts, HOME of this user is set to / where the user does not have write access.
With HOME set to /tmp, everything now works fine.
Perhaps adding a check to cypress whether HOME is writable would be helpful?
Same here with 4.6.0 on Jeninks CI pipeline. I saw on another thread installing WSL can solve the issue but there is no way it is the ONLY solution. The longer this remains unsolved more people will move on to other e2e candidates.
Yeah, looks like I’m on outdated info, WSLg support for Windows 10 has been added recently. I’m not sure if this issue is still needed then, I don’t have an environment to reproduce it anymore.
I’m seeing the same behaviour with 4.8.0 on Jenkins. Jenkins starts a docker image based on cypress/browsers. Cypress runs fine locally in this image, but hangs on Jenkins.
Dockerfile:
Debug output on Jenkins:
Debug output in Docker running locally (on Kubuntu):
ldd output:
I am seeing the same behavior with 4.7.0. Hangs on smoketest and never completes.