To speed up tests run, there is pytest-xdist, which lets you run tests in parallel.
But right now we can't do that because we are using some gRPC mock server that actually serves connection and when multiple tests using this run at the same time, they will share the same server and conflict.
Proposed solution
Ideally stop using the gRPC mock server and just use regular python mocks instead. If not possible maybe consider isolating the servers used in different tests or see if there is a way to declare tests dependency.
Use cases
No response
Alternatives and workarounds
No response
Additional context
With 8 cores and using 12 workers (using less workers still doesn't saturate the CPUs, I guess tests have too much wait time), tests run in 10s, while without parallelization they take 28s.
This means that when running nox, we should be able to go from 1 minutes to 20s!
What's needed?
To speed up tests run, there is
pytest-xdist
, which lets you run tests in parallel.But right now we can't do that because we are using some gRPC mock server that actually serves connection and when multiple tests using this run at the same time, they will share the same server and conflict.
Proposed solution
Ideally stop using the gRPC mock server and just use regular python mocks instead. If not possible maybe consider isolating the servers used in different tests or see if there is a way to declare tests dependency.
Use cases
No response
Alternatives and workarounds
No response
Additional context
With 8 cores and using 12 workers (using less workers still doesn't saturate the CPUs, I guess tests have too much wait time), tests run in 10s, while without parallelization they take 28s.
This means that when running
nox
, we should be able to go from 1 minutes to 20s!