pytest-dev / pytest-dev/pytest-xdist

Suppressing warnings triggers "Different tests were collected between" error for Python 3.8

Open
#808 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.9k
Forks
287
Avg merge
9h 30m
Merged PRs (30d)
2

Description

I very recently started getting the "Different tests were collected between gwX and gwY" error when running tests with multiple workers. It only happens under specific circumstances though. The circumstances are:

  • python=3.8
  • Number of workers > 2
  • Warnings suppressed with "-p no:warnings" option

Versions:

$ conda list | grep pytest
pytest                    7.1.2            py38h578d9bd_0    conda-forge
pytest-forked             1.4.0              pyhd8ed1ab_0    conda-forge
pytest-xdist              2.5.0              pyhd8ed1ab_0    conda-forge

The other Python versions that I tested with were 3.7 and 3.9. I had no issues with them.

I found #432 but because of the specific circumstances, I created a new issue. I can close this and post the relevant info on that issue if needed.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with Python 3.8, more than two workers, and the -p no:warnings option, comparing collection results across workers. Trace the distributed test-collection path to identify why workers disagree, then verify that the same command completes with consistent collections.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.