signals should be blocked in thread when using thread timeout method
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- testing-qa
調査の方向性
pytest-timeout にあるスレッドベースのタイムアウト実装を見つけ、内部スレッドがどのように開始されるかを確認してください。Issue で説明されている signal.pthread_sigmask の動作を確認し、そのうえで既存のタイムアウト動作を変更せずに、タイムアウトスレッドでシグナルが引き続きブロックされることを検証してください。
索引モデルが issue の本文から書いたものです。
説明
Original report by Christopher Hunt (Bitbucket: chrahunt, GitHub: chrahunt).
Currently in Python it's only possible to change your signal disposition on a thread-specific basis using signal.pthread_sigmask. When a test depends on certain signals being blocked but we use the thread method for pytest-timeout, the signal is still received by the process via the internal thread maintained by pytest-timeout and it is then propagated to the main thread by the Python runtime.
The fix is to surround the thread start with something like
old_mask = signal.pthread_sigmask(signal.SIG_SETMASK, range(1, signal.NSIG))
t.start()
signal.pthread_sigmask(signal.SIG_SETMASK, old_mask)
This works because the signal mask is inherited by spawned threads, and also avoids a potential race condition if we were to set the signal mask inside the thread target function itself.
Currently I work around this issue by patching threading.Thread.start to do the same as above.
- 主要言語
- 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 ·