pytest-dev / pytest-dev/pytest-forked
Mac: Bad file descriptor
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 83
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
Not sure why this has suddenly changed, but tests are now erroring on Mac OSX runners. Worst part is that the process doesn't end after this error, so the CI doesn't fail until it timeouts after 15 minutes.
See test results here (I've also verified on a separate PR, so it's not related to the coverage version bump):
https://github.com/aio-libs/aiohttp-devtools/actions/runs/3783707241/jobs/6439936092
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/_pytest/main.py", line 348, in pytest_runtestloop
INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pytest_forked/__init__.py", line 51, in pytest_runtest_protocol
INTERNALERROR> reports = forked_run_report(item)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/pytest_forked/__init__.py", line 73, in forked_run_report
INTERNALERROR> ff = py.process.ForkedFunc(runforked)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/py/_process/forkedfunc.py", line 50, in __init__
INTERNALERROR> self._child(nice_level, child_on_start, child_on_exit)
INTERNALERROR> File "/Users/runner/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/py/_process/forkedfunc.py", line 74, in _child
INTERNALERROR> stdout.close()
INTERNALERROR> OSError: [Errno 9] Bad file descriptor
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure on a Mac OSX runner using the linked GitHub Actions results. Trace the pytest_forked path through pytest_forked/init.py and the reported py/_process/forkedfunc.py stdout.close() call. Done means the tests no longer raise the bad-file-descriptor error and the process exits instead of waiting for the CI timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, python
- Domain
- ci-cd, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100