Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Pytest times out in debug mode with Pycharm 2023.2.1

オープン
#152 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
testing-qa

調査の方向性

報告されたpytestのタイムアウト設定とtests/unittests/utils/test_banned_passwords.py::test_is_password_bannedを使用して、PyCharm 2023.2.1でタイムアウトを再現する。デバッグモードでの動作を以前のPyCharmバージョンと比較する;デバッグモードでテストがタイムアウトしなくなり、通常の実行では設定されたタイムアウトが引き続き適用されれば完了とする。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Python
スター
258
フォーク
69
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pytest-dev/pytest-timeout のほかの issue

pytest-dev/pytest-timeout の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。