Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support parallel snapshots calls (#168)
* Fix parallel builds When parallel builds occur there is the posibility that the same assets will be triggerd on the same pooled page, this means that there is a likely outcome that the resource will be intercepted and handled twice, this is illegal with puppeteer. Polling available pages up to 10 is also memory intensive for sequential builds as 10 pages will be in memory. This can cause issues in low memory enviroments. - Remove pooling and open close pages on demand to reduce memory footprint - Open new page on demand to ensure that parallel builds that request same resource do not conflict which causes the puppeteer to throw up error that request is already handled. - Add catch clauses around request interception to ensure that e2e tests continue if there is an issue with percy. * Create page pool for sequential builds only Add page pool for sequential builds, to reduce execution overhead when creating new page - Add checks to detirmine sequential build to create page pool at setup - Add checks to ensure page pool has been setup for sequential build * Use generic-pool Use generic pool to create a pool for both parallel builds and serial builds. The pool will create page instances on demand, releasing them after requests are finished. * Update naming - Rename pool to pagePool - Create constants for the page pool size with configuration via env variable * Add test to capture multiple snapshots fired at once
- Loading branch information