pytest-dev / pytest-dev/pytest-xdist

LoadError: unkown opcode '\x00'

Open
#142 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.9k
Forks
287
Avg merge
9h 30m
Merged PRs (30d)
2

Description

I get this weird issue on Windows/PyPy5.7.1:

pypy-30-43 inst-nodeps: f:\projects\pytest-cov\.tox\dist\pytest-cov-2.5.0.zip
pypy-30-43 installed: apipkg==1.4,appdirs==1.4.3,cffi==1.10.0,colorama==0.3.9,coverage==4.3.4,execnet==1.4.1,fields==5.0.0,greenlet==0.4.12,packaging==16.8,process-tests==1.2.1,py
=1.4.33,pyparsing==2.2.0,pytest==3.0.7,pytest-capturelog==0.7,pytest-cov==2.5.0,pytest-xdist==1.16.0,readline==6.2.4.1,six==1.10.0,virtualenv==15.1.0
pypy-30-43 runtests: PYTHONHASHSEED='103'
pypy-30-43 runtests: commands[0] | pytest test_things.py -n 2 --cov --cov-report=term --max-slave-restart=0
============================= test session starts =============================
platform win32 -- Python 2.7.13[pypy-5.7.1-final], pytest-3.0.7, py-1.4.33, pluggy-0.4.0
rootdir: f:\projects\pytest-cov, inifile: setup.cfg
plugins: xdist-1.16.0, cov-2.5.0, capturelog-0.7
gw0 C / gw1 C[gw0] node down: Traceback (most recent call last):
  File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\execnet\gateway_base.py", line 841, in _local_receive
    data = loads_internal(data, channel, strconfig)
  File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\execnet\gateway_base.py", line 1350, in loads_internal
    return Unserializer(io, channelfactory, strconfig).load()
  File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\execnet\gateway_base.py", line 1160, in load
    "wire protocol corruption?" % (opcode,))
LoadError: unkown opcode '\x00' - wire protocol corruption?

Slave restarting disabled
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\main.py", line 98, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\main.py", line 132, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\vendored_packages\pluggy.py", line 745, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\vendored_packages\pluggy.py", line 339, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\vendored_packages\pluggy.py", line 334, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\vendored_packages\pluggy.py", line 614, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "<remote exec>", line 43, in pytest_collection
INTERNALERROR>   File "<remote exec>", line 25, in sendevent
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\execnet\gateway_base.py", line 716, in send
INTERNALERROR>     raise IOError("cannot send to %r" % (self,))
INTERNALERROR> IOError: cannot send to <Channel id=1 closed>
[gw1] node down: Traceback (most recent call last):
  File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\execnet\gateway_base.py", line 841, in _local_receive
    data = loads_internal(data, channel, strconfig)
  File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\execnet\gateway_base.py", line 1350, in loads_internal
    return Unserializer(io, channelfactory, strconfig).load()
  File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\execnet\gateway_base.py", line 1160, in load
    "wire protocol corruption?" % (opcode,))
LoadError: unkown opcode '\x00' - wire protocol corruption?

Slave restarting disabled
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\main.py", line 98, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\main.py", line 132, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\vendored_packages\pluggy.py", line 745, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\vendored_packages\pluggy.py", line 339, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\vendored_packages\pluggy.py", line 334, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\_pytest\vendored_packages\pluggy.py", line 614, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "<remote exec>", line 43, in pytest_collection
INTERNALERROR>   File "<remote exec>", line 25, in sendevent
INTERNALERROR>   File "f:\projects\pytest-cov\.tox\pypy-30-43\site-packages\execnet\gateway_base.py", line 716, in send
INTERNALERROR>     raise IOError("cannot send to %r" % (self,))
INTERNALERROR> IOError: cannot send to <Channel id=1 closed>

Any clues as to what is wrong?

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

Reproduce the reported command from test_things.py on Windows with PyPy 5.7.1, then start at execnet/gateway_base.py where loads_internal and Unserializer.load report the protocol error. Compare the worker and controller behavior around the pytest-xdist distributed run; done means identifying the cause of the corrupted wire protocol and confirming a fix with the same scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, testing
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.