https://pantsbuild.org/ logo
#general
Title
# general
r

ripe-cpu-85141

10/28/2022, 7:49 PM
I'm testing
[pytest].xdist_enabled = true
. I wonder if I should add pytest-xdist on
[pytest].extra_requirements
(I guess yes given it is on the default value). And also I don't see much difference. The execution seems to set
-n 1
on the pytest command line. But I have 2 cpus. Is it expected?
s

sparse-lifeguard-95737

10/28/2022, 8:09 PM
the final value for
-n
is set by the engine, and depends on the number of other processes Pants is concurrently running - so if you have many tests running at the same time it makes sense they might all end up with
-n 1
šŸ˜¢
I just put up a PR to enable testing multiple python files within a single
pytest
process - Iā€™m excited to play around with combining that feature with
xdist
to get one process with a big value for
-n
r

ripe-cpu-85141

10/28/2022, 8:12 PM
oh, so on my 2 cpus machine, if pants runs two pytest processes, it's expected to see -
n 1
, right?
s

sparse-lifeguard-95737

10/28/2022, 8:13 PM
yup
r

ripe-cpu-85141

10/28/2022, 8:14 PM
Ah ok. I guess it won't change my run time then šŸ™‚ thanks!
5 Views