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

chore: note on using puppeteer >= 3 & ouf of memory docs update #552

Closed
artemgurzhii opened this issue Aug 20, 2020 · 5 comments
Closed

Comments

@artemgurzhii
Copy link

We are using Percy integration with Gitlab and we have problems with it.

Here is a bit more detailed explanation of our problem.

The solution is to add '--disable-dev-shm-usage' to the puppeteer launch args, but I'm not sure that everyone who is using that package will need it. Therefore I'm proposing to delegate those flags to be passed by the user using .percy.yml config and use default flags(current flags) unless no flags were passed/defined through the config file. In that way, it will not break any current builds + will have backward compatibility with the previous/future releases

@artemgurzhii artemgurzhii changed the title feat: allo configuring puppeteer flags feat: allow configuring puppeteer flags Aug 20, 2020
@artemgurzhii
Copy link
Author

After thinking a bit more, I think it would be a good idea to allow users to have more control over the puppeteer configuration(not only on the flags). Allow user having/passing their own puppeteer launch config & merge default config with the user one.

What are your thoughts?

@artemgurzhii artemgurzhii changed the title feat: allow configuring puppeteer flags WIP: feat: allow configuring puppeteer flags Aug 20, 2020
@artemgurzhii
Copy link
Author

P.S. Moving to WIP for now as with all flags added I still receive [0820/163249.466981:FATAL:memory.cc(38)] Out of memory. size=262144(I have configured dumpio: true puppeteer flag) with the error (node:103) UnhandledPromiseRejectionWarning: Error: Page crashed!

@artemgurzhii
Copy link
Author

The problem was with the puppeteer. All the following information concerns only when launching on the Gitlab.

We are running our tests on the k8s GitLab runner.

With version 5.0.0(3.3.0 of the previous release was also working the same way) it was throwing UnhandledPromiseRejectionWarning: Error: Page crashed! error after some amount of screenshots taken(in our case, 11 screenshots were taken before that error was thrown).

After adding dumpio: true we got more context and it was showing

[0821/101733.184844:FATAL:memory.cc(38)] Out of memory. size=262144

We have tried to add different args to the puppeteer launch command

args: [
  '--disable-gpu', 
  '--no-sandbox', 
  '--disable-setuid-sandbox', 
  '--disable-dev-shm-usage',
],

but that didn't work. Also, we have tried to increase resources dedicated to the job which also didn't help.

Finally, we have fixed it by using resolutions. Adding

"resolutions": {
  "**/puppeteer": "2.1.1"
}

fixed the issue.

There is a dedicated issue at the puppeteer repo for that but I think it worth mentioning in the Percy docs of what to do when someone has the same problem. Feel free to close

@artemgurzhii artemgurzhii changed the title WIP: feat: allow configuring puppeteer flags chore: note on using puppeteer >= 3 & ouf of memory docs update Aug 21, 2020
@lukeselker
Copy link

Thanks @artemgurzhii !

I'm using npm so the resolutions code was a little different for me, but it worked all the same

"resolutions": {
  "puppeteer": "2.1.1"
}

@Robdel12
Copy link
Contributor

With the last agent based SDK migrated to CLI, you can check the migration doc to see how you can upgrade: https://docs.percy.io/docs/migrating-to-percy-cli#completed

The new SDK toolchain (@percy/cli and friends) no longer uses Puppeteer

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

3 participants