Skip to content

Report timing out despite having __coverage__ #134

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

Closed
brettz9 opened this issue Feb 11, 2020 · 6 comments · Fixed by #135
Closed

Report timing out despite having __coverage__ #134

brettz9 opened this issue Feb 11, 2020 · 6 comments · Fixed by #135
Assignees
Labels

Comments

@brettz9
Copy link

brettz9 commented Feb 11, 2020

Hi,

For some reason, with cypress run or cypress open can be set even when only visiting a page to ensure coverage on the server end), I'm getting the error:

CypressError: cy.task('coverageReport') timed out after waiting 60000ms.

Because this error occurred during a 'after all' hook we are skipping all of the remaining tests.

I'm getting the following debugging output before the error.

  code-coverage parsed sent coverage +0ms
  code-coverage wrote coverage file /Users/brett/node-login/.nyc_output/out.json +1ms

  code-coverage parsed sent coverage +150ms
  code-coverage wrote coverage file /Users/brett/node-login/.nyc_output/out.json +2ms
  code-coverage saving coverage report using command: "nyc report --report-dir ./coverage --temp-dir /Users/brett/node-login/.nyc_output --reporter=text --reporter=html --reporter=lcov" +29ms
  code-coverage current working directory is /Users/brett/node-login +0ms

(Then the timeout occurs.)

I've added a mostly empty placeholder script file--with just a console.log statement even for those files which are only intended to be loaded to trigger server coverage, and I've confirmed that after instrumenting, this instrumented file is being loaded and that __coverage__ is set within it, but I'm still getting the above error.

Is there anything else I should be looking for besides an absent __coverage__?

@bahmutov
Copy link
Contributor

Hmm, is the .nyc_output coverage object especially large by any chance? Do you have both frontend and backend code coverage?

@brettz9
Copy link
Author

brettz9 commented Feb 11, 2020

Yes, both frontend and backend. One coverage file is 2.4MB (out.json is 264KB). I do see now in testing the command $(npm bin)/nyc report --report-dir ./coverage --temp-dir /Users/brett/node-login/.nyc_output --reporter=text --reporter=html --reporter=lcov that it takes quite some time.

@bahmutov
Copy link
Contributor

Hmm, probably increasing task timeout to more than 1 minute should be enough. I will add it as an option to cypress.json config

@bahmutov bahmutov self-assigned this Feb 11, 2020
@bahmutov
Copy link
Contributor

Actually, I will just increase the default timeout for that task to 3 minutes

@bahmutov
Copy link
Contributor

🎉 This issue has been resolved in version 1.12.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MY729
Copy link

MY729 commented Oct 27, 2020

I configure the timeout configuration in cypress.json:

"defaultCommandTimeout": 90000,
"pageLoadTimeout": 90000

Still prompted this error:

CypressError: `cy.task('coverageReport')` timed out after waiting `90000ms`.

https://on.cypress.io/task

Because this error occurred during a `after all` hook we are skipping all of the remaining tests.
      at http://localhost:8090/__cypress/runner/cypress_runner.js:147046:19
      at tryCatcher (http://localhost:8090/__cypress/runner/cypress_runner.js:10384:23)
      at http://localhost:8090/__cypress/runner/cypress_runner.js:5506:41
      at tryCatcher (http://localhost:8090/__cypress/runner/cypress_runner.js:10384:23)
      at Promise._settlePromiseFromHandler (http://localhost:8090/__cypress/runner/cypress_runner.js:8319:31)
      at Promise._settlePromise (http://localhost:8090/__cypress/runner/cypress_runner.js:8376:18)
      at Promise._settlePromise0 (http://localhost:8090/__cypress/runner/cypress_runner.js:8421:10)
      at Promise._settlePromises (http://localhost:8090/__cypress/runner/cypress_runner.js:8497:18)
      at _drainQueueStep (http://localhost:8090/__cypress/runner/cypress_runner.js:5091:12)
      at _drainQueue (http://localhost:8090/__cypress/runner/cypress_runner.js:5084:9)
      at Async.../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:8090/__cypress/runner/cypress_runner.js:5100:5)
      at Async.drainQueues (http://localhost:8090/__cypress/runner/cypress_runner.js:4970:14)
  From Your Spec Code:
      at Context.generateReport (http://localhost:8090/__cypress/tests?p=cypress/support/index.js:342:8)

There are the above problems when running on jenkins

When I ran locally, I didn’t have this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants