Closed shakori999 closed 2 years ago
If you launch pytest with -o faulthandler_timeout=5
(adjust seconds as needed), it should give you a trackeback of the hang. Where does that point to? FWIW I doubt this is a bug in pytest.
this is the output
(django-taxi-app) PS C:\Users\shako\Desktop\taxi-app\server\driver_app\taxi> pytest -o faulthandler_timeout=5
=================================================== test session starts ===================================================
platform win32 -- Python 3.7.3, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
django: settings: taxi.settings (from ini)
rootdir: C:\Users\shako\Desktop\taxi-app, configfile: pytest.ini
plugins: asyncio-0.16.0, django-4.5.2
collected 14 items
trips\tests\test_http.py .... [ 28%]
trips\tests\test_websocket.py .........Timeout (0:00:05)!
Thread 0x00002ff0 (most recent call first):
File "c:\users\shako\appdata\local\programs\python\python37\lib\concurrent\futures\thread.py", line 78 in _worker
File "c:\users\shako\appdata\local\programs\python\python37\lib\threading.py", line 865 in run
File "c:\users\shako\appdata\local\programs\python\python37\lib\threading.py", line 917 in _bootstrap_inner
File "c:\users\shako\appdata\local\programs\python\python37\lib\threading.py", line 885 in _bootstrap
Thread 0x00001558 (most recent call first):
File "c:\users\shako\appdata\local\programs\python\python37\lib\selectors.py", line 314 in _select
File "c:\users\shako\appdata\local\programs\python\python37\lib\selectors.py", line 323 in select
File "c:\users\shako\appdata\local\programs\python\python37\lib\asyncio\base_events.py", line 1739 in _run_once
File "c:\users\shako\appdata\local\programs\python\python37\lib\asyncio\base_events.py", line 539 in run_forever
File "c:\users\shako\appdata\local\programs\python\python37\lib\asyncio\base_events.py", line 571 in run_until_complete
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pytest_asyncio\plugin.py", line 195 in inner
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\python.py", line 183 in pytest_pyfunc_call
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\python.py", line 1641 in runtest
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\runner.py", line 162 in pytest_runtest_call
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\runner.py", line 255 in <lambda>
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\runner.py", line 311 in from_call
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\runner.py", line 255 in call_runtest_hook
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\runner.py", line 215 in call_and_report
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\runner.py", line 126 in runtestprotocol
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\runner.py", line 109 in pytest_runtest_protocol
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\main.py", line 348 in pytest_runtestloop
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\main.py", line 323 in _main
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\main.py", line 269 in wrap_session
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\main.py", line 316 in pytest_cmdline_main
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\config\__init__.py", line 163 in main
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\lib\site-packages\_pytest\config\__init__.py", line 185 in console_main
File "C:\Users\shako\Desktop\taxi-app\server\django-taxi-app\Scripts\pytest.exe\__main__.py", line 7 in <module>
File "c:\users\shako\appdata\local\programs\python\python37\lib\runpy.py", line 85 in _run_code
File "c:\users\shako\appdata\local\programs\python\python37\lib\runpy.py", line 193 in _run_module_as_main
according to the traceback, it seems like you have a network hangup thats not running to completion and is not wrapped with a timeout/cancelation
Taking the freedom to convert this to a discussion, as it indeed doesn't look like a bug in pytest.
I'm working on a django channel project, i did more than 10 tests it works fine, but the last one is running forever. i wanna make a test for if a driver can update the trip or not(code of the test under the output) ,
the output of
pip list
ispytest and operation system -v
this is my test in test_websocket.py
and this is my consumer.py file
when i run pytest it stills like this