cypress: cypress run (v13.6.5 and v13.6.6) hangs on Docker (M2 Mac) using --platform=linux/amd64
Current behavior
Setup
- Docker Desktop on macOS Sonoma 14.4
- Emulating to platform linux/amd64 in order to use Chrome browser
- Attempted with Node v20 and v21
- Attempted with Electron and Chrome
- This works as expected when --platform=linux/amd64 is removed, but that limits the browser choice to just Electron
cypress run fails with 13.6.5 and 13.6.6
When using cypress version 13.6.5 and 13.6.6, executing cypress run fails as it just hangs right after announcing it is about to start the test.
DEBUG: cypress:* prints this before hanging:
cypress:server:run about to run spec {
"spec":{
"absolute":"/cypress/cypress/e2e/test.cy.ts",
"fileExtension":".ts",
"fileName":"test",
"name":"test.cy.ts",
"relative":"cypress/e2e/test.cy.ts"
},
"isHeadless":true,
"browser":{
"channel":"stable",
"displayName":"Electron",
"family":"chromium",
"majorVersion":118,
"name":"electron",
"path":"",
"version":"118.0.5993.159"
}
} +32ms
The entire debug output of DEBUG: cypress:*:error is:
cypress:snapshot:error TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received undefined
cypress:snapshot:error at new NodeError (node:internal/errors:405:5)
cypress:snapshot:error at validateString (node:internal/validators:162:11)
cypress:snapshot:error at Object.resolve (node:path:1097:7)
cypress:snapshot:error at Object.resolve (evalmachine.<anonymous>:1:765400)
cypress:snapshot:error at resolvePathsAndParent (<embedded>:4511:1077511)
cypress:snapshot:error at customRequire (<embedded>:4511:1076567)
cypress:snapshot:error at c (<embedded>:2827:111097)
cypress:snapshot:error at <embedded>:2827:111632
cypress:snapshot:error at <embedded>:4511:18500
cypress:snapshot:error at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) +0ms
cypress:snapshot:error TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received undefined
cypress:snapshot:error at new NodeError (node:internal/errors:405:5)
cypress:snapshot:error at validateString (node:internal/validators:162:11)
cypress:snapshot:error at Object.resolve (node:path:1097:7)
cypress:snapshot:error at Object.resolve (evalmachine.<anonymous>:1:765400)
cypress:snapshot:error at resolvePathsAndParent (<embedded>:4511:1077539)
cypress:snapshot:error at customRequire (<embedded>:4511:1076567)
cypress:snapshot:error at c (<embedded>:2827:111097)
cypress:snapshot:error at <embedded>:2827:111632
cypress:snapshot:error at <embedded>:4511:18500
cypress:snapshot:error at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) +1ms
And it hangs as follows:
cypress run succeeds with 13.6.4
When using cypress version 13.6.4 with the setup otherwise identical, the test completes as expected except it instead prints this message:
[754:0308/191324.311425:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.portal.Settings.Read: object_path= /org/freedesktop/portal/desktop: unknown error type:
Desired behavior
cypress run executes successfully with the latest version, without hanging, and without error messages.
Test code to reproduce
- Clone this repo: https://github.com/DI-Studios/cypress-in-docker-hangs-on-mac
- Start the container from the repo root with
docker compose run --interactive --build --rm cypress - Inside the container run
cypress run
Cypress Version
13.6.6
Node version
v20.11.0
Operating System
macOS 14.4
Debug Logs
See gist: https://gist.github.com/josh-distudios/5640d35efc0b542df0a78706e1ad6f9e
Other
I’ve had a look at the cypress:snapshot:error to see if I can work out where it’s coming from, but it appears on 13.6.4 which runs successfully so I’m not sure it’s related to this error.
I’ve also searched the logs for the term “error” which showed that playwright-webkit is missing, but when I installed this locally it didn’t have resolve the issue.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 10
- Comments: 16 (2 by maintainers)
Commits related to this issue
- Downgrade Cypress and regenerate baselines Latest Cypress doesn't play well with Docker on M1, see https://github.com/cypress-io/cypress/issues/29095 — committed to isaacphysics/isaac-react-app by mwtrew 2 years ago
- Cypress visual regression testing (#998) * Partial cypress configuration * Add basic Cypress component testing config * Configure visual regression testing * Support site-specific visual tes... — committed to isaacphysics/isaac-react-app by mwtrew 2 years ago
Just adding - I’m also seeing this and can reproduce the issue from @josh-atkins github repo. I’m running an M1 Mac Sonoma 14.3.1.
This has been causing pain while dockerising our tests and I had no idea why!
I am seeing this as well.
Mac M3, Mac OS Sonoma 14.5 Cypress 13.17.0
Using the
cypress/included:13.17.0docker image, hangs:This is making it impossible to run our Cypress visual regression tests on any ARM-based Mac. And switching to Electron is not an option for us, as it has strange rendering differences that make our visual regression tests flaky and unreliable (as in, we’ll run the tests in Electron on one machine, accept differences, then run them on another machine and get visual differences, which is exactly what running in a Docker image was supposed to fix).
Is there any effort being made to fix this?
@jennifer-shehane any updates on this? From my conversation with our Cypress TAM I understand that access to M1 and M2 architecture at Cypress is limited but we are severely impaired by this as our local environment doesn’t match the tests in CI and produces inconsistent results.
I wasn’t able to recreate this with the example on my Intel Mac. I’ll have to get someone with an M1 to try it next.
Electron was updated in 13.6.5, so I would suspect that is the cause for this behavior.
Same issue on Mac OS 13.6 , processor M1
it hangs.