Skip to content

pytest hangs #6

@cavokz

Description

@cavokz

I run pytest, it hangs at the end. I interrupted it, this is the whole output:

=================================================================== test session starts ====================================================================
platform darwin -- Python 3.12.0rc2, pytest-7.4.2, pluggy-1.3.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /Users/cavok/devel/interpreters.git
configfile: pyproject.toml
plugins: hypothesis-6.86.2, benchmark-4.0.0
collected 3 items

interpreter_class.py .                                                                                                                               [ 33%]
module_functions.py .                                                                                                                                [ 66%]
threading_interpreter.py .                                                                                                                           [100%]

========================================================================== PASSES ==========================================================================
__________________________________________________________________ test_interpreter_class __________________________________________________________________
------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------
Before thread.start()
interp = Interpreter(id=2, isolated=True)
interp.id = InterpreterID(2)
interp.is_running() = False
--------------------
In t(), before sleep(3)After thread.start()

interp = Interpreter(id=2, isolated=True)interp = Interpreter(id=2, isolated=True)

interp.id = InterpreterID(2)interp.id = InterpreterID(2)

interp.is_running() = Falseinterp.is_running() = False

----------------------------------------

In t(), after sleep(3)
interp = Interpreter(id=2, isolated=True)
interp.id = InterpreterID(2)
interp.is_running() = False
--------------------
After thread.join()
interp = Interpreter(id=2, isolated=True)
interp.id = InterpreterID(2)
interp.is_running() = False
--------------------
__________________________________________________________________ test_module_functions ___________________________________________________________________
------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------
interps = [Interpreter(id=3, isolated=True),
 Interpreter(id=4, isolated=True),
 Interpreter(id=5, isolated=True),
 Interpreter(id=6, isolated=True)]
all = [Interpreter(id=0, isolated=None),
 Interpreter(id=1, isolated=None),
 Interpreter(id=3, isolated=None),
 Interpreter(id=4, isolated=None),
 Interpreter(id=5, isolated=None),
 Interpreter(id=6, isolated=None)]
interpreters.get_current() = Interpreter(id=0, isolated=None)
interpreters.get_main() = Interpreter(id=0, isolated=None)
________________________________________________________________ test_threading_interpreter ________________________________________________________________
------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------
Before thread.start(), interp.is_running() = False
After thread.start(), interp.is_running() = False
..................................................After thread.join(), interp.is_running() = False
End of interp job
================================================================= short test summary info ==================================================================
PASSED interpreter_class.py::test_interpreter_class
PASSED module_functions.py::test_module_functions
PASSED threading_interpreter.py::test_threading_interpreter
==================================================================== 3 passed in 5.82s =====================================================================


^CException ignored in: <module 'threading' from '/Users/cavok/.pyenv/versions/3.12.0rc2/lib/python3.12/threading.py'>
Traceback (most recent call last):
  File "/Users/cavok/.pyenv/versions/3.12.0rc2/lib/python3.12/threading.py", line 1602, in _shutdown
    lock.acquire()
KeyboardInterrupt:
Fatal Python error: PyInterpreterState_Delete: remaining subinterpreters
Python runtime state: finalizing (tstate=0x000000010cb88868)

zsh: abort      python3 -mpytest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions