Pytest times out in debug mode with Pycharm 2023.2.1
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Riproduci il timeout con PyCharm 2023.2.1 usando tests/unittests/utils/test_banned_passwords.py::test_is_password_banned e la configurazione di timeout di pytest indicata. Confronta il comportamento in modalità debug con le versioni precedenti di PyCharm; il lavoro è completato quando il test non va più in timeout in modalità debug, mentre il timeout configurato continua ad applicarsi durante le esecuzioni normali.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I am getting the timeout error below when running a test in debug mode with pytest under Pycharm 2023.2.1.
This timeout depends on the timeout value pytest is configured with. I am not getting this issue with older versions of Pycharm. So basically, Pycharm does not ignore the timeout in debug mode.
Note: this issue is similar to this one
Connected to pydev debugger (build 232.9559.58)
/Users/williamafonso/Programming/sara/.venv/bin/python3.11 /Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client 127.0.0.1 --port 55298 --file /Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pycharm/_jb_pytest_runner.py --target test_banned_passwords.py::test_is_password_banned
Testing started at 14:34 ...
Launching pytest with arguments test_banned_passwords.py::test_is_password_banned --no-header --no-summary -q in /Users/williamafonso/Programming/sara/tests/unittests/utils
============================= test session starts ==============================
collecting ... collected 1 item
test_banned_passwords.py::test_is_password_banned
+++++++++++++++++++++++++++++++++++ Timeout ++++++++++++++++++++++++++++++++++++
~~~~~~~~~~~~~~~~~~ Stack of pydevd.CommandThread (6153744384) ~~~~~~~~~~~~~~~~~~
File "/Users/williamafonso/.pyenv/versions/3.11.3/lib/python3.11/threading.py", line 995, in _bootstrap
self._bootstrap_inner()
File "/Users/williamafonso/.pyenv/versions/3.11.3/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 219, in run
self._on_run()
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 150, in _on_run
self._py_db_command_thread_event.wait(0.3)
File "/Users/williamafonso/.pyenv/versions/3.11.3/lib/python3.11/threading.py", line 622, in wait
signaled = self._cond.wait(timeout)
File "/Users/williamafonso/.pyenv/versions/3.11.3/lib/python3.11/threading.py", line 324, in wait
gotit = waiter.acquire(True, timeout)
~~~~~~~~~~~~~~~~~~~~~ Stack of pydevd.Reader (6136918016) ~~~~~~~~~~~~~~~~~~~~~~
File "/Users/williamafonso/.pyenv/versions/3.11.3/lib/python3.11/threading.py", line 995, in _bootstrap
self._bootstrap_inner()
File "/Users/williamafonso/.pyenv/versions/3.11.3/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 219, in run
self._on_run()
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 293, in _on_run
r = self.sock.recv(1024)
~~~~~~~~~~~~~~~~~~~~~ Stack of pydevd.Writer (6120091648) ~~~~~~~~~~~~~~~~~~~~~~
File "/Users/williamafonso/.pyenv/versions/3.11.3/lib/python3.11/threading.py", line 995, in _bootstrap
self._bootstrap_inner()
File "/Users/williamafonso/.pyenv/versions/3.11.3/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 219, in run
self._on_run()
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 368, in _on_run
cmd = self.cmdQueue.get(1, 0.1)
File "/Users/williamafonso/.pyenv/versions/3.11.3/lib/python3.11/queue.py", line 180, in get
self.not_empty.wait(remaining)
File "/Users/williamafonso/.pyenv/versions/3.11.3/lib/python3.11/threading.py", line 324, in wait
gotit = waiter.acquire(True, timeout)
~~~~~~~~~~~~~~~~~~~~~~~ Stack of MainThread (8016781440) ~~~~~~~~~~~~~~~~~~~~~~~
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 2199, in <module>
main()
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 2181, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 1493, in run
return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 1500, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pycharm/_jb_pytest_runner.py", line 60, in <module>
sys.exit(pytest.main(args, plugins_to_load + [Plugin]))
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/config/__init__.py", line 168, in main
ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/main.py", line 317, in pytest_cmdline_main
return wrap_session(config, _main)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/main.py", line 270, in wrap_session
session.exitstatus = doit(config, session) or 0
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/main.py", line 324, in _main
config.hook.pytest_runtestloop(session=session)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/main.py", line 349, in pytest_runtestloop
item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 114, in pytest_runtest_protocol
runtestprotocol(item, nextitem=nextitem)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 133, in runtestprotocol
reports.append(call_and_report(item, "call", log))
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 222, in call_and_report
call = call_runtest_hook(item, when, **kwds)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 261, in call_runtest_hook
return CallInfo.from_call(
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 341, in from_call
result: Optional[TResult] = func()
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 262, in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 169, in pytest_runtest_call
item.runtest()
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1792, in runtest
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/Users/williamafonso/Programming/sara/.venv/lib/python3.11/site-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
result = testfunction(**testargs)
File "/Users/williamafonso/Programming/sara/tests/unittests/utils/test_banned_passwords.py", line 8, in test_is_password_banned
banned_passwords = BannedPasswords()
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 1160, in do_wait_suspend
self._do_wait_suspend(thread, frame, event, arg, suspend_type, from_this_thread)
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 1175, in _do_wait_suspend
time.sleep(0.01)
+++++++++++++++++++++++++++++++++++ Timeout ++++++++++++++++++++++++++++++++++++
Process finished with exit code 1
- Lingua principale
- Python
- Stelle
- 258
- Fork
- 69
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytest-dev/pytest-timeout
-
PR #200 introduced breaking change - `timeout` value in config is incompatible with older versions Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
pytest-dev/pytest-timeout#203 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
pytest-dev/pytest-timeout#190 · 9 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
pytest-dev/pytest-timeout#189 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
pytest-dev/pytest-timeout#181 · 4 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
pytest-dev/pytest-timeout#178 · 1 commento ·
Tutte le issue di pytest-dev/pytest-timeout
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
huggingface/Repo2RLEnv#163 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
NousResearch/hermes-agent#121143 ·