timeout does not terminate the test process when used with xdist
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- testing-qa
調査の方向性
test_simple_hang.py にある再現テストから始め、thread と signal の両方の timeout メソッドを使って、ドキュメントに記載された pytest コマンドを実行します。--boxed と xdist を使った場合の timeout の動作を確認します。完了の条件は、timeout したテストのプロセスがアクティブなまま残らずに終了し、リソースを解放することです。
索引モデルが issue の本文から書いたものです。
説明
Summary
running pytest-timeout with pytest-xdist doesn't terminate the test process.
This creates an issue if I would like to test a long-running computation-intensive function: the test process keeps running even after the timeout and the resources are not released until I manually kill the process.
Some version info from pytest
platform darwin -- Python 3.7.6, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
rootdir: /private/tmp/test_hang
plugins: cov-2.10.0, xdist-1.34.0, timeout-1.4.2, forked-1.3.0
timeout: 10.0s
timeout method: thread
timeout func_only: False
To reproduce
Create a simple test case (test_simple_hang.py) like this:
import time
import os
def test():
print(os.getpid())
time.sleep(60)
Running the following command:
pytest --timeout=10 --boxed --timeout_method=thread test_simple_hang.py
After the timeout, if I do ps -ef | grep <pid>, the process remains active.
It also occurs when --timeout_method=signal.
- 主要言語
- Python
- スター
- 258
- フォーク
- 69
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytest-dev/pytest-timeout のほかの issue
-
PR #200 introduced breaking change - `timeout` value in config is incompatible with older versions オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
pytest-dev/pytest-timeout#203 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pytest-dev/pytest-timeout#190 · コメント 9 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pytest-dev/pytest-timeout#189 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
pytest-dev/pytest-timeout#181 · リアクション 4 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
pytest-dev/pytest-timeout#178 · コメント 1 件 ·
pytest-dev/pytest-timeout の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
huggingface/Repo2RLEnv#163 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NousResearch/hermes-agent#121143 ·