question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Percy snapshot times out when run on CI

See original GitHub issue

Getting the following:

CypressError: cy.request() timed out waiting 30000ms for a response from your server.
--
4583 |  
4584 | The request we sent was:
4585 |  
4586 | Method: POST
4587 | URL: http://localhost:5338/percy/snapshot

This happens consistently on every run. I am using the following:

  • Cypress 4.2
  • Cypress docker image (chrome 69)
  • Running on AWS Codebuild for CI (using the standard image)

I already bumped SHM to 8g so it seems unlikely that this is the problem. I also disabled Chrome web security.

What is surprising, is that Percy successfully starts the build (and stops it when the build manages to get to that point). Just the snapshot call seems to fail

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
wwilsmancommented, Jun 15, 2020

Thanks @OzTK!

Just finished looking those logs over and I think I see what might be causing the issue. I’ll answer here for any future visitors with a similar problem.

I wasn’t entirely correct before when I said there might be assets hanging. But it is indeed the asset discovery service that is hanging. The asset discovery service uses Puppeteer and a page pool to discover assets. What seems to be happening is the page pool is not able to open a Puppeteer page and gets stuck repeatedly trying until the timeout. That’s why you see so many newPage logs.

Unfortunately, the pooling library does not log the error when retrying and so I’m still not entirely sure what is going wrong. I did notice that you are using an image with Chrome 69 and setting Puppeteer environment variables to suppress it’s automatic download. I think maybe this version of Chrome is not compatible with the latest version of Puppeteer. Try removing those Puppeteer environment variables so Puppeteer can download a compatible version to see if it starts working. If it does work, you’ll have to increase your Chrome version to a compatible one.

0reactions
OzTKcommented, Jul 15, 2020

Confirming that this problem was solved by updating the Cypress docker image we were using. We re-evaluated our requirements and bumped it to Chrome 78, which worked. It is a big inconvenience not to have control over the browser version when updating Percy though. Cypress allows to target specific versions, which is great, it would be a huge improvement if Percy was doing the same. The main problem is that there is no explicit mentioning of which version of Chrome works with which version of Percy. There is also a discrepancy between the version used in percy-cypress and the one used in percy-storybook (those are the 2 we use). I know this constraint comes with Puppeteer, but making it explicit and documented would save a lot of trouble to users of Percy 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Percy Snapshot
The Percy CLI snapshot command is the easiest way to start visual testing. With Percy, you can visually test virtually anything that runs...
Read more >
Ability to set cypress command timeout for snapshot upload ...
Hei. I ran into an issue in CI where cypress is throwing an error for the tests that use .percySnapshot.
Read more >
Visual testing and review platform | Percy by BrowserStack
Percy helps teams automate visual testing. It captures screenshots, compares them against the baseline, and highlights visual changes with every commit.
Read more >
Painlessly setup Cypress & Percy with Github Actions in minutes
Install Percy locally. Implement a test. Sign up. Test locally. Test in CI. Pull Request integration. Further customization. Custom selector.
Read more >
Cypress.io + Percy = End-to-end functional and visual testing ...
Link to slides: slides.com/bahmutov/visual-testing-with-percy/Other helpful ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found