tonybaloney / Pyjion

Pyjion - A JIT for Python based upon CoreCLR
https://www.trypyjion.com
MIT License
1.42k stars 59 forks source link

Running pyjion with pytest-xdist causes Python exception #456

Open tonybaloney opened 2 years ago

tonybaloney commented 2 years ago

Related to #454

python -m pytest tests -n auto
======================================================================================== test session starts =========================================================================================
platform darwin -- Python 3.10.0rc2+, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /Users/anthonyshaw/CLionProjects/pyjion/tests, configfile: pytest.ini
plugins: xdist-2.4.0, forked-1.3.0
gw0 [747] / gw1 [747] / gw2 [747] / gw3 [747]
..INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/anthonyshaw/CLionProjects/pyjion/.venv-3.10d/lib/python3.10/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/anthonyshaw/CLionProjects/pyjion/.venv-3.10d/lib/python3.10/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/anthonyshaw/CLionProjects/pyjion/.venv-3.10d/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/anthonyshaw/CLionProjects/pyjion/.venv-3.10d/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/anthonyshaw/CLionProjects/pyjion/.venv-3.10d/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/anthonyshaw/CLionProjects/pyjion/.venv-3.10d/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/anthonyshaw/CLionProjects/pyjion/.venv-3.10d/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/anthonyshaw/CLionProjects/pyjion/.venv-3.10d/lib/python3.10/site-packages/xdist/dsession.py", line 112, in pytest_runtestloop
INTERNALERROR>     self.loop_once()
INTERNALERROR>   File "/Users/anthonyshaw/CLionProjects/pyjion/.venv-3.10d/lib/python3.10/site-packages/xdist/dsession.py", line 135, in loop_once
INTERNALERROR>     call(**kwargs)
INTERNALERROR>   File "/Users/anthonyshaw/CLionProjects/pyjion/.venv-3.10d/lib/python3.10/site-packages/xdist/dsession.py", line 174, in worker_workerfinished
INTERNALERROR>     assert not crashitem, (crashitem, node)
INTERNALERROR> AssertionError: ('test_attr.py::test_missing_attr[2]', <WorkerController gw1>)
INTERNALERROR> assert not 'test_attr.py::test_missing_attr[2]'
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=0 mode='r' encoding='UTF-8'>
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=0 mode='r' encoding='UTF-8'>
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=0 mode='r' encoding='UTF-8'>
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=0 mode='r' encoding='UTF-8'>

========================================================================================= 2 passed in 7.34s ==========================================================================================
tonybaloney commented 2 years ago

this is actually caused by the existence of the hook. https://github.com/pytest-dev/pytest-xdist/issues/674