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

timeout does not terminate the test process when used with xdist

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

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

評価

難易度
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 はありません

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

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

はじめの一歩

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

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

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

似ている issue

Python の issue をもっと見る

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

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