pytest-dev / pytest-dev/pytest-xdist

bad file descriptor on windows

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

These kinds of errors appear when running the pyinstaller tests in parallel on appevor.

_________________________ test_chdir_meipass[onefile] _________________________
[gw0] win32 -- Python 3.6.1 c:\python36-x64\python.exe
self = <CallInfo when='call' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000007B80D672F0>
when = 'call'
    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()
c:\python36-x64\lib\site-packages\_pytest\runner.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
c:\python36-x64\lib\site-packages\_pytest\runner.py:145: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
c:\python36-x64\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
c:\python36-x64\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
c:\python36-x64\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
c:\python36-x64\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
c:\python36-x64\lib\site-packages\_pytest\vendored_packages\pluggy.py:250: in _wrapped_call
    wrap_controller.send(call_outcome)
c:\python36-x64\lib\site-packages\_pytest\capture.py:138: in pytest_runtest_call
    self.suspendcapture_item(item, "call")
c:\python36-x64\lib\site-packages\_pytest\capture.py:155: in suspendcapture_item
    out, err = self.suspendcapture(in_=in_)
c:\python36-x64\lib\site-packages\_pytest\capture.py:96: in suspendcapture
    outerr = cap.readouterr()
c:\python36-x64\lib\site-packages\_pytest\capture.py:319: in readouterr
    self.err.snap() if self.err is not None else "")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <FDCapture 2 oldfd=9>
    def snap(self):
        f = self.tmpfile
>       f.seek(0)
E       OSError: [Errno 9] Bad file descriptor
c:\python36-x64\lib\site-packages\_pytest\capture.py:365: OSError
!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 5 failu

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 Windows AppVeyor failure while running the pytest tests in parallel, focusing on test_chdir_meipass[onefile] and the captured OSError: [Errno 9] Bad file descriptor traceback. Trace the interaction between parallel execution and pytest capture, then verify that the failure no longer occurs in the affected Windows test run.

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.