pytest-dev / pytest-dev/pytest-xdist

Choking on pipenv's tests: can't serialize <class '_io.TextIOWrapper'>

Open
#381 2 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

When building the pipenv 2018.11.14 for Fedora, we use pytest xdist (so does upstream) and I found a weird error when xdist is used. The testsuite works without xdist.

The errors remind me:

https://gist.github.com/khamidou/6b7e8702f8fc0e8dd251

and

https://github.com/pytest-dev/pytest-xdist/issues/349

yet it is a bit different:

Notable exceptions:

execnet.gateway_base.DumpError: can't serialize <class '_io.TextIOWrapper'>
KeyError: <class '_io.TextIOWrapper'>
OSError: cannot send to <Channel id=3 closed>

Full log:

============================= test session starts ==============================
platform linux -- Python 3.7.1, pytest-3.9.3, py-1.7.0, pluggy-0.8.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /builddir/build/BUILD/pipenv-2018.11.14, inifile: pytest.ini
plugins: xdist-1.24.1, forked-0.2, flaky-3.4.0
gw0 I / gw1 I / gw2 I / gw3 I

[gw0] linux Python 3.7.1 cwd: /builddir/build/BUILD/pipenv-2018.11.14

[gw1] linux Python 3.7.1 cwd: /builddir/build/BUILD/pipenv-2018.11.14

[gw2] linux Python 3.7.1 cwd: /builddir/build/BUILD/pipenv-2018.11.14

[gw3] linux Python 3.7.1 cwd: /builddir/build/BUILD/pipenv-2018.11.14

[gw0] Python 3.7.1 (default, Nov  5 2018, 09:51:25)  -- [GCC 8.2.1 20181011 (Red Hat 8.2.1-4)]

[gw1] Python 3.7.1 (default, Nov  5 2018, 09:51:25)  -- [GCC 8.2.1 20181011 (Red Hat 8.2.1-4)]

[gw2] Python 3.7.1 (default, Nov  5 2018, 09:51:25)  -- [GCC 8.2.1 20181011 (Red Hat 8.2.1-4)]

[gw3] Python 3.7.1 (default, Nov  5 2018, 09:51:25)  -- [GCC 8.2.1 20181011 (Red Hat 8.2.1-4)]
INTERNALERROR> Traceback (most recent call last):
gw0 [145] / gw1 [145] / gw2 [145] / gw3 [145]
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1383, in _save
INTERNALERROR>     dispatch = self._dispatch[tp]
INTERNALERROR> KeyError: <class '_io.TextIOWrapper'>
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/main.py", line 184, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/main.py", line 223, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/warnings.py", line 147, in pytest_collection
INTERNALERROR>     yield
INTERNALERROR>   File "/usr/lib64/python3.7/contextlib.py", line 119, in __exit__
INTERNALERROR>     next(self.gen)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/warnings.py", line 97, in catch_warnings_for_item
INTERNALERROR>     kwargs=dict(warning_message=warning_message, when=when, item=item)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/hooks.py", line 306, in call_historic
INTERNALERROR>     res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "<remote exec>", line 136, in pytest_warning_captured
INTERNALERROR>   File "<remote exec>", line 30, in sendevent
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 717, in send
INTERNALERROR>     self.gateway._send(Message.CHANNEL_DATA, self.id, dumps_internal(item))
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1354, in dumps_internal
INTERNALERROR>     return _Serializer().save(obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1372, in save
INTERNALERROR>     self._save(obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1475, in save_tuple
INTERNALERROR>     self._save(item)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1471, in save_dict
INTERNALERROR>     self._write_setitem(key, value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1465, in _write_setitem
INTERNALERROR>     self._save(value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1471, in save_dict
INTERNALERROR>     self._write_setitem(key, value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1465, in _write_setitem
INTERNALERROR>     self._save(value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1388, in _save
INTERNALERROR>     raise DumpError("can't serialize %s" % (tp,))
INTERNALERROR> execnet.gateway_base.DumpError: can't serialize <class '_io.TextIOWrapper'>
scheduling tests via LoadScheduling
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1383, in _save
INTERNALERROR>     dispatch = self._dispatch[tp]
INTERNALERROR> KeyError: <class '_io.TextIOWrapper'>
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/main.py", line 184, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/main.py", line 223, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/warnings.py", line 147, in pytest_collection
INTERNALERROR>     yield
INTERNALERROR>   File "/usr/lib64/python3.7/contextlib.py", line 119, in __exit__
INTERNALERROR>     next(self.gen)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/warnings.py", line 97, in catch_warnings_for_item
INTERNALERROR>     kwargs=dict(warning_message=warning_message, when=when, item=item)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/hooks.py", line 306, in call_historic
INTERNALERROR>     res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "<remote exec>", line 136, in pytest_warning_captured
INTERNALERROR>   File "<remote exec>", line 30, in sendevent
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 717, in send
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1383, in _save
INTERNALERROR>     self.gateway._send(Message.CHANNEL_DATA, self.id, dumps_internal(item))
INTERNALERROR>     dispatch = self._dispatch[tp]
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1354, in dumps_internal
INTERNALERROR> KeyError: <class '_io.TextIOWrapper'>
INTERNALERROR>     return _Serializer().save(obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1372, in save
INTERNALERROR> 
INTERNALERROR>     self._save(obj)
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR> 
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1475, in save_tuple
INTERNALERROR>     self._save(item)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/main.py", line 184, in wrap_session
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/main.py", line 223, in _main
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1471, in save_dict
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>     self._write_setitem(key, value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1465, in _write_setitem
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>     self._save(value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1471, in save_dict
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>     self._write_setitem(key, value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1465, in _write_setitem
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     self._save(value)
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1388, in _save
INTERNALERROR>     raise DumpError("can't serialize %s" % (tp,))
INTERNALERROR> execnet.gateway_base.DumpError: can't serialize <class '_io.TextIOWrapper'>
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/warnings.py", line 147, in pytest_collection
INTERNALERROR>     yield
INTERNALERROR>   File "/usr/lib64/python3.7/contextlib.py", line 119, in __exit__
INTERNALERROR>     next(self.gen)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/warnings.py", line 97, in catch_warnings_for_item
INTERNALERROR>     kwargs=dict(warning_message=warning_message, when=when, item=item)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/hooks.py", line 306, in call_historic
INTERNALERROR>     res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "<remote exec>", line 136, in pytest_warning_captured
INTERNALERROR>   File "<remote exec>", line 30, in sendevent
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 717, in send
INTERNALERROR>     self.gateway._send(Message.CHANNEL_DATA, self.id, dumps_internal(item))
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1354, in dumps_internal
INTERNALERROR>     return _Serializer().save(obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1372, in save
INTERNALERROR>     self._save(obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1475, in save_tuple
INTERNALERROR>     self._save(item)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1471, in save_dict
INTERNALERROR>     self._write_setitem(key, value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1465, in _write_setitem
INTERNALERROR>     self._save(value)
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1383, in _save
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1471, in save_dict
INTERNALERROR>     self._write_setitem(key, value)
INTERNALERROR>     dispatch = self._dispatch[tp]
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1465, in _write_setitem
INTERNALERROR> KeyError: <class '_io.TextIOWrapper'>
INTERNALERROR>     self._save(value)
INTERNALERROR> 
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1388, in _save
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR>     raise DumpError("can't serialize %s" % (tp,))
INTERNALERROR> execnet.gateway_base.DumpError: can't serialize <class '_io.TextIOWrapper'>
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/main.py", line 184, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/main.py", line 223, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/warnings.py", line 147, in pytest_collection
INTERNALERROR>     yield
INTERNALERROR>   File "/usr/lib64/python3.7/contextlib.py", line 119, in __exit__
INTERNALERROR>     next(self.gen)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/warnings.py", line 97, in catch_warnings_for_item
INTERNALERROR>     kwargs=dict(warning_message=warning_message, when=when, item=item)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/hooks.py", line 306, in call_historic
INTERNALERROR>     res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "<remote exec>", line 136, in pytest_warning_captured
INTERNALERROR>   File "<remote exec>", line 30, in sendevent
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 717, in send
INTERNALERROR>     self.gateway._send(Message.CHANNEL_DATA, self.id, dumps_internal(item))
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1354, in dumps_internal
INTERNALERROR>     return _Serializer().save(obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1372, in save
INTERNALERROR>     self._save(obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1475, in save_tuple
INTERNALERROR>     self._save(item)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1471, in save_dict
INTERNALERROR>     self._write_setitem(key, value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1465, in _write_setitem
INTERNALERROR>     self._save(value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1390, in _save
INTERNALERROR>     dispatch(self, obj)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1471, in save_dict
INTERNALERROR>     self._write_setitem(key, value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1465, in _write_setitem
INTERNALERROR>     self._save(value)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 1388, in _save
INTERNALERROR>     raise DumpError("can't serialize %s" % (tp,))
INTERNALERROR> execnet.gateway_base.DumpError: can't serialize <class '_io.TextIOWrapper'>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/main.py", line 184, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/_pytest/main.py", line 224, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/xdist/dsession.py", line 115, in pytest_runtestloop
INTERNALERROR>     self.loop_once()
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/xdist/dsession.py", line 138, in loop_once
INTERNALERROR>     call(**kwargs)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/xdist/dsession.py", line 235, in worker_collectionfinish
INTERNALERROR>     self.sched.schedule()
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/xdist/scheduler/load.py", line 249, in schedule
INTERNALERROR>     self._send_tests(next(nodes), 1)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/xdist/scheduler/load.py", line 261, in _send_tests
INTERNALERROR>     node.send_runtest_some(tests_per_node)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/xdist/workermanage.py", line 262, in send_runtest_some
INTERNALERROR>     self.sendcommand("runtests", indices=indices)
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/xdist/workermanage.py", line 278, in sendcommand
INTERNALERROR>     self.channel.send((name, kwargs))
INTERNALERROR>   File "/builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/execnet/gateway_base.py", line 716, in send
INTERNALERROR>     raise IOError("cannot send to %r" % (self,))
INTERNALERROR> OSError: cannot send to <Channel id=3 closed>
========================= 12 warnings in 3.63 seconds ==========================

Warnings without xdist:

=============================== warnings summary ===============================
tests/integration/conftest.py:30
  /builddir/build/BUILD/pipenv-2018.11.14/tests/integration/conftest.py:30: RuntimeWarning: Cannot connect to HTTPBin...
    warnings.warn('Cannot connect to HTTPBin...', RuntimeWarning)

tests/integration/conftest.py:31
  /builddir/build/BUILD/pipenv-2018.11.14/tests/integration/conftest.py:31: RuntimeWarning: Will skip tests requiring Internet
    warnings.warn('Will skip tests requiring Internet', RuntimeWarning)

tests/integration/conftest.py:51
  /builddir/build/BUILD/pipenv-2018.11.14/tests/integration/conftest.py:51: RuntimeWarning: Cannot connect to GitHub via SSH
    'Cannot connect to GitHub via SSH', RuntimeWarning

tests/integration/conftest.py:54
  /builddir/build/BUILD/pipenv-2018.11.14/tests/integration/conftest.py:54: RuntimeWarning: Will skip tests requiring SSH access to GitHub
    'Will skip tests requiring SSH access to GitHub', RuntimeWarning

check_pythonpath/pytz/__init__.py:493
  /builddir/build/BUILD/pipenv-2018.11.14/check_pythonpath/pytz/__init__.py:493: ResourceWarning: unclosed file <_io.TextIOWrapper name='/usr/share/zoneinfo/zone.tab' mode='r' encoding='UTF-8'>
    for l in open(os.path.join(_tzinfo_dir, 'zone.tab'))

The last one seems familiar to the exception above.


As I file this, the more I think about it, this seems like https://github.com/pytest-dev/pytest-xdist/issues/349

I'll file it anyway, if it later shows up, it is not.

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 test run with pytest xdist and compare it with a run without xdist. Read the linked pytest-xdist issue and inspect the traceback around execnet serialization of _io.TextIOWrapper; done means the test suite completes under xdist without the serialization and closed-channel errors.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.