cypress
cypress copied to clipboard
Cypress cy.screenshot() timeout during `cypress run`
Current behavior:
All of our tests pass locally, but when running the Codeship CI we get errors for a few tests.
The error during Codeship CI builds: CypressError: cy.screenshot() timed out waiting '30000ms' to complete.
Desired behavior:
All tests pass in Codeship CI
Steps to reproduce:
For our app the reproduction is running the ci:codeship
command runs which calls cy:record
"cy:record": "cypress run --record --key *key* --config video=false", "ci:codeship": "start-server-and-test start http://localhost:5000 cy:record"
I'm not exactly sure how to reproduce this other than creating a Codeship Basic app and attempting to run tests there. I have seen a few other issues point to a problem with how Cypress and Codeship interact.
Versions
Cypress version: 3.4.1
Sidenote: We are using the cypress-autorecord
package, but it doesn't seem like this is involved.
@taylorpreston Did you ever resolve this issue? I am experience similar problems
@lleewwiiss We never figured out what was causing this issue. We think it has to do with cypress beginning to run tests on the application before it has finished starting. The errors we received were the first 2-5 tests.
I am also experiencing the same error.
Also been getting this on 3.5.0 and 3.6.1.
I also have this issue with 3.8.1 and Chrome 79 on CircleCI's ubuntu-1604:201903-01
machine. It's not there with Chrome 78 or the embedded version of Electron. It's probably related to #6023.
- Can you run Cypress in debug mode mode and print the entire set of logs here?
- Can you provide the machine and machine version they are running into this issue with, that would be appreciated.
- Provide the browser you are running within (Electron, Chrome + version).
I don't think this is related directly to https://github.com/cypress-io/cypress/issues/6023
@taylorpreston I meet the same issue, did you find out the solution for this issue?
Hello, I have the same issue starting with 3.8.2 (and above) currently. Cypress 3.8.1 works correctly though.
We're using cypress/included docker image in Gitlab CI and keep getting these error messages:
CypressError: cy.screenshot() timed out waiting '60000ms' to complete.
It won't appear in every test and I can't see a pattern in those fails yet. At the moment, I'm struggling with getting debug mode to run, but I'll give an update as soon as I can provide some logs. I hope this first information can help nevertheless. Thank you in advance for all help, information etc.!
I can confirm with @leichteckig that this issue is occurring as described:
"... 3.8.2 (and above) currently. Cypress 3.8.1 works correctly though.
We're using cypress/included docker image in Gitlab CI and keep getting these error messages:
CypressError: cy.screenshot() timed out waiting '60000ms' to complete."
Only difference is that I am using Azure DevOps CI and their container services.
I can alsoI confirm with @leichteckig that this issue is occurring as described.
We are using Gitlab CI with Ubuntu CI runners and your docker image cypress/browsers:node12.14.0-chrome79-ff71
CypressError: cy.screenshot() timed out waiting '60000ms' to complete."
random, masks errors also...It doesn't happen locally on desktop/laptop.
Glad I read through this to figure out downgrading to 3.8.1 would solve the issue.
I am having some variation on this issue. It was just happening for one specific test. Was running 3.6.1 and upgraded to 3.8.1, didn't help. When running the test locally I could see the real reason that the test was failing (instead of the screenshot timeout like CI was claiming). So for me it was mostly an issue of a bad error message i CI.
@Powersource exactly what I meant by sometimes it also masks the true reason for the test fail
I just upgraded Cypress to 4.0.1
, and we now started to see tests failing on Github Actions with screenshot() timeout warning 😢
Need info
I still have questions that have gone unanswered in this thread that are necessary for investigation.
- What browser are you running? What version of the browser?
- Are you running with
--headless
flag? - What machine and machine version are you running?
- Are you calling the
cy.screenshot()
command directly? Are you using a plugin that calls thecy.screenshot()
command?
Chrome 79 bug?
There has been some speculation that this may be caused by the Chrome 79 performance bug detailed here: https://github.com/cypress-io/cypress/issues/6023#issuecomment-584472171
If you are running on Chrome 79, we've released a docker image for Chrome 80 found here: https://github.com/cypress-io/cypress-docker-images/tree/master/browsers/node13.6.0-chrome80-ff72 at cypress/browsers:node13.6.0-chrome80-ff72
.
Please try to update to using Chrome 80. If this is related to #6023 it may fix your issue.
Hi @jennifer-shehane.
Need info
I still have questions that have gone unanswered in this thread that are necessary for investigation.
- What browser are you running? What version of the browser? Chrome 79.0.3945.130
- Are you running with
--headless
flag? No- What machine and machine version are you running? ubuntu-16.04
- Are you calling the
cy.screenshot()
command directly? Are you using a plugin that calls thecy.screenshot()
command? noChrome 79 bug?
There has been some speculation that this may be caused by the Chrome 79 performance bug detailed here: #6023 (comment)
If you are running on Chrome 79, we've released a docker image for Chrome 80 found here: https://github.com/cypress-io/cypress-docker-images/tree/master/browsers/node13.6.0-chrome80-ff72 at
cypress/browsers:node13.6.0-chrome80-ff72
.Please try to update to using Chrome 80. If this is related to #6023 it may fix your issue.
I tried using chrome 80 in my Github actions:
jobs:
e2eTests:
runs-on: ubuntu-16.04
container: cypress/browsers:node13.6.0-chrome80-ff72
Using the above container seems to give errors like this, and all tests fails:
[HPM] Error occurred while trying to proxy request /graphql from localhost:4200 to http://localhost:1337 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
Our setup is an Angular + Graphql Node.js Express application. Is there something special I need to make this work when running in containers - or do you want me to open that as a separate issue?
But screenshots seems to be working 🔥
@alexbjorlig Hmm, I haven't seen the ECONNREFUSED error for proxy requests before. Yeah, I would open a new issue. May be more due to the Node upgrade.
The fact that screenshots work in Chrome 80 is very promising though. Thanks for the update.
@jennifer-shehane - thanks, I will create a new issue for the ECONNREFUSED.
Update After looking at my logs, I can see that the problem is that our Node server uses a mongo in-memory server. This package has a problem, when running in docker, as described here.
Is there another way to run Cypress with Chrome80? I tried using runs-on: ubuntu-latest
, (where the mongodb memory server works without issues), but here the Chrome version is 79 😢
Final update My build now works with the Chrome80 container, you can see the details here.
Hello there,
A little update: I tried Cypress' docker images with Chrome 80 (Cypress 4.0.0 and newer) as recommended in https://github.com/cypress-io/cypress/issues/6023#issuecomment-584472171 and after a week or so, I don't see any more screenshot related failures until now.
In 3.8.2, there was Chrome 79 installed iirc. So it looks like it was the mentioned Chrome bug for me as well. Thank you so much for your advice! :+1:
Just upgraded to cypress/browsers:node12.16.1-chrome80-ff73
and this has broken my test builds using Codebuild.
We're seeing this on Chrome 80.0.3987.122 (Official Build) (64-bit)
I have observed two different behaviors in MacOS Mojave with Node JS 13 and Chrome v80.
- Running directly
cypress run --browser chrome
, you will get a lot of timeouts. If it occurs once, then the next screenshot command will follow. - Running indirectly via
cypress open
then, selectchrome browser
. It successfully completes the tests.
This is weird!
I have observed two different behaviors in MacOS Mojave with Node JS 13 and Chrome v80.
- Running directly
cypress run --browser chrome
, you will get a lot of timeouts. If it occurs once, then the next screenshot command will follow.- Running indirectly via
cypress open
then, selectchrome browser
. It successfully completes the tests.This is weird!
We have had a similar issue, restarting our devices seemed to solve this particular issue so i assume it's device resources related.
@rhzs I believe this is due to some memory leak in caching test information. We have observed the same thing on machines with less ram (<=8GB. Setting "numTestsKeptInMemory": 0
fixed it for us, but that makes debugging more difficult
We're also seeing this on Chrome 80.
I have seen it today too, it was first time
Seeing this when using the 4.2.0 included docker image. Tried reverting back to an older image 3.8.1 and I am still seeing it. It started happening when I tried to use log-to-console-output and I cant make it go away even when I have removed all references to it
I have the same problem with cypress 4.2.0 with electron browser running on TravisCI on ubuntu I run locally in docker with 800mb and cant reproduce the issue.
Seems that problem is solved on Travis CI when I have start the cypress with --headless --browser chrome
params. The chrome version is 73 in Travis CI.
Hm... It seems that setting numTestsKeptInMemory to 0 helps me and it is working with chrome 80 in Travis.
I'm getting this problem on a Mac in the Electron browser. I have a rather long page and the problem disappeared when I removed the cypress-failed-log plugin. I'm gonna have to try the other recommended plugin to work around the Issue "Capture + Display all logs for everything that happens in Cypress" #448