Giter Club home page Giter Club logo

Comments (3)

dvic avatar dvic commented on August 15, 2024 1

Not sure if it'll help though, it sounds a bit like you have a more general issue with your CI setup? Are you just trying to print a whole lot of PDFs in parallel? If so, increasing the number of sessions to spawn would probably help.

This did help actually, thanks! Also, I've removed async: true from the tests that use ChromicPDF, which results in having more cpu available when the tests run.

In the end, ChromicPDF's session pool was never designed to function as a queue. In other words: If you want to print 6 PDFs in parallel with 5 workers, it by design should error on the 6th PDF (minus the allowed 5s checkout timeout). If you want to queue work up, you need to add a queue (e.g. Oban). The sole purpose of the pool is to provide (bounded) parallelism.

Makes sense!

Or another idea: Spawn a chromic process in the test (ExUnit's start_supervised) and inject the chromic instance to use into the test unit (via process dict, for instance). That way you would simply start another browser for each test that wants to print a PDF.

I'll keep this in mind if the problem pop-ups again. Thanks!

from chromic_pdf.

maltoe avatar maltoe commented on August 15, 2024

Guess you can give it a try 🤷

Not sure if it'll help though, it sounds a bit like you have a more general issue with your CI setup? Are you just trying to print a whole lot of PDFs in parallel? If so, increasing the number of sessions to spawn would probably help. Or maybe add a work queue and simply assert that a print job has been added?

In the end, ChromicPDF's session pool was never designed to function as a queue. In other words: If you want to print 6 PDFs in parallel with 5 workers, it by design should error on the 6th PDF (minus the allowed 5s checkout timeout). If you want to queue work up, you need to add a queue (e.g. Oban). The sole purpose of the pool is to provide (bounded) parallelism.

from chromic_pdf.

maltoe avatar maltoe commented on August 15, 2024

Or another idea: Spawn a chromic process in the test (ExUnit's start_supervised) and inject the chromic instance to use into the test unit (via process dict, for instance). That way you would simply start another browser for each test that wants to print a PDF.

from chromic_pdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.