Skip to content
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

Problem with docker integration #215

Closed
JBustin opened this issue May 20, 2020 · 2 comments
Closed

Problem with docker integration #215

JBustin opened this issue May 20, 2020 · 2 comments

Comments

@JBustin
Copy link

JBustin commented May 20, 2020

Hello,

I try to run my cypress + percy integration tests in docker, for a sandboxed integration in CI.
Cypress run command works.
Percy-cypress exec command also works without PERCY_TOKEN.
But Percy-cypress exec command fails with PERCY_TOKEN.
It seems that there is a problem when percy-cypress tries to push data to percy-agent :

The request we sent was:

Method: POST
URL: http://localhost:5338/percy/snapshot

No response was received within the timeout.

https://on.cypress.io/request
...

My dockerfile :

FROM cypress/base:10
RUN mkdir -p /usr/app/src
WORKDIR /usr/app/src
COPY .docker/cypress/package* ./cypress.json ./
ENV CI=1
RUN npm ci
CMD ["npm", "start"]

And the package.json used to build the docker image :

{
  "name": "cypress-container",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "percy exec -t 350 -- cypress run"
  },
  "dependencies": {
    "@percy/cypress": "^2.3.1",
    "cypress": "^4.5.0"
  }
}

Am I missing something ?
Is there an other way to use cypress + percy inside docker ?

Regards

Ps: other thing, failing builds never finish

[percy] stopping percy...
[percy] waiting for 3 snapshots to complete...

Capture d’écran 2020-05-20 à 16 57 47

@JBustin JBustin changed the title Docker support Inside docker support May 20, 2020
@JBustin JBustin changed the title Inside docker support Problem inside docker integration May 20, 2020
@JBustin JBustin changed the title Problem inside docker integration Problem with docker integration May 22, 2020
@JBustin
Copy link
Author

JBustin commented May 25, 2020

After a lot of tests, I cannot reproduce my own previous error, but I have a new one, more expected :

(node:18) UnhandledPromiseRejectionWarning: Error: Page crashed!
    at Page._onTargetCrashed (/usr/app/src/node_modules/puppeteer/lib/Page.js:200:28)
    at CDPSession.Page.client.on (/usr/app/src/node_modules/puppeteer/lib/Page.js:120:57)

It seems that puppeteer is not proper configured to run in docker : puppeteer/puppeteer#1321 (comment)

Puppeteer is runned by percy. Any idea to resolve it ?

Regards

[Edit] could not there be an official docker image for percy-cypress ?

@JBustin
Copy link
Author

JBustin commented May 25, 2020

I've finally find the trick by using --shm-size docker option :

docker run --shm-size=256m ...

Just look at the builds that never finish...

And probably, some tricks to improve the docker image. I think it should be great to share a docker image or Dockerfile example.

@JBustin JBustin closed this as completed May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant