pytest-dev / pytest-dev/pytest-xdist

execnet.gateway_base.DumpError: can't serialize <class '_pytest.warning_types.RemovedInPytest4Warning'>

Open
#364 2 comments 2 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

Stumbled upon this with borg's tests: https://travis-ci.org/borgbackup/borg/jobs/439508853#L2123

  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1383, in _save
    dispatch = self._dispatch[tp]
KeyError: <class '_pytest.warning_types.RemovedInPytest4Warning'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1072, in executetask
    do_exec(co, loc)  # noqa
  File "<string>", line 1, in do_exec
  File "<remote exec>", line 261, in <module>
  File "<remote exec>", line 25, in __init__
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/_pytest/config/__init__.py", line 303, in register
    ret = super(PytestPluginManager, self).register(plugin, name)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/pluggy/manager.py", line 101, in register
    hook._maybe_apply_history(hookimpl)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/pluggy/hooks.py", line 331, in _maybe_apply_history
    res = self._hookexec(self, [method], kwargs)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/pluggy/manager.py", line 67, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/pluggy/manager.py", line 61, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "<remote exec>", line 135, in pytest_warning_captured
  File "<remote exec>", line 29, in sendevent
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 717, in send
    self.gateway._send(Message.CHANNEL_DATA, self.id, dumps_internal(item))
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1354, in dumps_internal
    return _Serializer().save(obj)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1372, in save
    self._save(obj)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1390, in _save
    dispatch(self, obj)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1475, in save_tuple
    self._save(item)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1390, in _save
    dispatch(self, obj)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1471, in save_dict
    self._write_setitem(key, value)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1465, in _write_setitem
    self._save(value)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1390, in _save
    dispatch(self, obj)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1471, in save_dict
    self._write_setitem(key, value)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1465, in _write_setitem
    self._save(value)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1390, in _save
    dispatch(self, obj)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1475, in save_tuple
    self._save(item)
  File "/Users/travis/build/borgbackup/borg/.tox/py34/lib/python3.4/site-packages/execnet/gateway_base.py", line 1388, in _save
    raise DumpError("can't serialize %s" % (tp,))
execnet.gateway_base.DumpError: can't serialize <class '_pytest.warning_types.RemovedInPytest4Warning'>
Replacing crashed worker gw0

Python 3.4.5, pytest-3.9.3, py-1.7.0, pluggy-0.8.0

Issue: https://github.com/borgbackup/borg/issues/4123

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

The traceback points to execnet/gateway_base.py, especially _Serializer.save/_save and channel send; begin by reproducing the Borg test failure with Python 3.4, pytest 3.9.3, and the listed dependencies. Done means the warning event crosses the worker channel without DumpError or worker replacement.

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
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.