pytest-dev / pytest-dev/pytest-xdist

pytest-xdist escapes from PyPy virtualenv

Open
#340 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

This is not a small reproducible example, but I still hope someone may find the report informative.

Some context

I have been running the scikit-learn test suite under PyPy3-6.0. Generally it passes except for one segfault.

More interestingly is that

pypy-env/site-packages/numpy/distutils/system_info.py:1459: in get_atlas_version
    c = cmd_config(Distribution())
[...]
        if not isinstance(dist, Distribution):
>           raise TypeError("dist must be a Distribution instance")
E           TypeError: dist must be a Distribution instance

/usr/local/lib-python/3/distutils/cmd.py:57: TypeError
  • tests marked with pytest.mark.skipif(platform.python_implementation() == 'PyPy') are run even though they shouldn't. They are indeed not run without pytest-xdist

Both of these points make me believe that while we start running tests with the PyPy interpreter, after the segfault in one of the tests, the new process is somehow recreated using the CPython interpreter instead.

Do you think this is plausible?

Another possibility could be some issue in the interaction between pytest-xdist and joblib.Parallel / loky.

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

Start by reproducing the reported PyPy3 failure with pytest-xdist using -n 1, comparing the linked CircleCI and pull-request logs with a run without xdist. Investigate whether the post-segfault process uses system CPython and whether PyPy-specific skipif tests run; done means the interpreter and skip behavior remain correct after recovery.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.