pytest-xdist fails to collect tests after identifying workers

77 views Asked by At

I am unable to figure out why pytest=xdist is failing to collect tests from the tests/sqlalchemy-dialect-compliance folder after it finishes identifying workers. We have used the tests in that folder for years with no problem if we simply use pytest, but as soon as we add pytest-xdist, all collection fails.

I am attempting to run tests on a Linux box (48 cores) in a docker container using pytest and pytest-xdist to get parallelization across the CPUs.

I can get pytest/pytest-xdist to recognize the right number of workers. But it never collects any tests no matter what settings I have and what I do.

I have tried many different settings in various combinations (using settings for dist, tx, numprocesses, etc). The most recent is as follows:

nox > py.test -s -vvv --dist=each '--tx 4*popen//python=python3.11' --numprocesses=4 tests/sqlalchemy_dialect_compliance
=== test session starts =============================================================
platform linux -- Python 3.11.6, pytest-8.0.0, pluggy-1.4.0 -- /repo/github.com/googleapis/python-bigquery-sqlalchemy/.nox/compliance/bin/python
cachedir: .pytest_cache
rootdir: /repo/github.com/googleapis/python-bigquery-sqlalchemy
configfile: setup.cfg
plugins: xdist-3.5.0, rerunfailures-13.0
4 workers [0 items]     
scheduling tests via EachScheduling

=== no tests ran in 0.51s ============================================================
nox > Command py.test -s -vvv --dist=each '--tx 4*popen//python=python3.11' --numprocesses=4 tests/sqlalchemy_dialect_compliance failed with exit code 5 # No tests collected.
nox > Session compliance failed.

with numprocesses=auto, it recognizes all 48 cores:

48 workers [0 items]

I have tried this with Python 3.11 and 3.12.

0

There are 0 answers