python / python/cpython

Tests using the same machine-wide resource should not run in parallel

オープン
#156,082 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

tests type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Feature or enhancement

Some resources which tests use are not per-process: the display, the sound device, the terminal. Two tests using one of them at the same time can interfere with each other, and regrtest runs test files in parallel by default.

Only tests using the same resource conflict. A GUI test can run in parallel with any non-GUI test, so pausing all the other tests would be too much.

These resources are already named on the command line: gui, audio, console and curses. A test declares which one it needs with requires(), requires_resource() or, for the memory, bigmemtest(), so those functions could lock the resource for the duration of the test or of the test file. The ~50 GUI modules, test_winsound, test_curses, test_winconsoleio and the bigmem tests would need no change.

The cost is that such tests no longer overlap each other: running test_tkinter, test_ttk and test_idle with -j4 takes as long as all three together (7.1 s here) instead of as long as the slowest (3.5 s). Tests which use no such resource keep running in parallel with them.

Linked PRs
  • gh-156902

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

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

はじめの一歩

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

調査の方向性

regrtest と issue で示されているリソース宣言、requires()、requires_resource()、bigmemtest() から始めます。GUI、audio、console、curses、bigmem のテストが現在どのようにリソースを宣言しているかを確認し、その後、同じリソースを共有するテストが重複して実行されなくなり、無関係なテストは引き続き並列で実行されることを検証します。

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

評価

技術スタック
python
領域
testing-qa
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

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

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