We have some heavy tests which consume a lot of me...
# general
We have some heavy tests which consume a lot of memory, for these tests we want to restrict the parallelism. Is there a way to reduce parallelism for some tests? While letting other tests run in parallel.
Indeed I was looking at this.
Copy code
I wouldn’t want to do because it will reduce performance.
I don’t really understand how this could be used to control parallelism.
is not used to control parallelism - it names an env var that will contain a “slot number” that your tests can use to assign unique databases or other resources
I don’t think there is a way to restrict parallelism for specific tests in a single pants run. But one thing you can do is create separate
targets for those heavy tests (and be sure to exclude those tests from the sources of the
target that owns the other tests in the same dir) . Then you can tag the heavy test targets. Then you can run Pants twice, once with
./pants test --process-execution-local-parallelism=1 --tag=heavy ::
and again with
./pants test --tag=-heavy ::
Thanks Benjy I think that would work indeed.
If you use the pytest-xdist parallelizer , you could use xdists segmentation functionality.