-
Notifications
You must be signed in to change notification settings - Fork 9
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
Move away from CliRunner in unit tests #47
Comments
"This only works in single-threaded systems without any concurrency as it changes the global interpreter state." |
Related to #30 |
subprocess or asyncio subprocess are likely to way to go here. |
I suggest we do not use threading. We are CPU-bound, and because of the GIL, threading does not gain us speed: It would if we were IO-bound. See also https://realpython.com/python-gil/ Instead, use multiprocessing. With multiprocessing, every process has its own GIL. That would mean the CLIRunner would continue working, is that right? We'd be single-threaded inside every process. GIL-less Python has started in 3.13. https://docs.python.org/3.13/whatsnew/3.13.html#free-threaded-cpython It'll be years and years before we can rely on it being the default installation on our target systems and we could consider threading - but tbh multiprocessing will be good enough for our use case, I predict. I see the value in writing all new tests in Existing tests could be a Fleissarbeit, but I don't think it's necessary. |
CliRunner seems to be working good still even if we are using multiprocessing internally with the |
The CliRunner from Click does not support concurrency which we are going to be using. We should find a better way and move away from using it.
The text was updated successfully, but these errors were encountered: