-
Notifications
You must be signed in to change notification settings - Fork 1
テスト: 全体テストを並列・2 分割で回し、重複した競合試験と繰り返しを減らす(#882 #884) #891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # #882 #884 テストの高速化(要求と受け入れ条件) | ||
|
|
||
| モード: `light`(テストと継続的統合の設定、テストを案内する文書だけを触る。本番のスクリプトは変えない) | ||
|
|
||
| ## 要求 | ||
|
|
||
| 全体テストを回すたびの待ちを縮める。手元・継続的統合・`cross-refactoring` の `--baseline-test` の | ||
| どれでも、全体テストの所要がそのまま待ちになっている(#880)。 | ||
|
|
||
| ## 範囲 | ||
|
|
||
| | 課題 | この変更で行う | 行わない(理由と行き先) | | ||
| | --- | --- | --- | | ||
| | #882 | 継続的統合の全体テストを `-n auto` で並列に回す。案内するコマンド(`CONTRIBUTING.md`・PR テンプレート・`docs/plugin-development-guide.md`・確定仕様 2 件)を並列の形にする。並列で壊れるテストを直す。並列にした後の継続的統合のジョブが 2 分 6 秒(テスト 1 分 53 秒)で 2 分を超えたため、ファイル単位の 2 分割(根の `conftest.py` の `SHARD_TOTAL` / `SHARD_INDEX`)とまとめジョブ `pytest` を置く(段 2) | — | | ||
| | #884 | 競合試験の重複を共通実装への 1 通りへ寄せる。繰り返しの回数を目的に必要な数まで減らす(`test_records_at_once_never_skip_a_stage` 8 → 4 回、`test_lock_held_passes` 4 → 3 回)。`release/**` の push 契機を外し、継続的統合の 2 重実行をやめる | `bg-wait.sh` のポーリング間隔(本番のスクリプトの変更)、ロックの上限 5 秒の注入(本番のスクリプトの変更。#293 の決定に関わる)、`test_git_facts.py` の猶予待ち(#883) | | ||
|
|
||
| ## 受け入れ条件 | ||
|
|
||
| | # | 条件 | 確かめ方 | | ||
| | --- | --- | --- | | ||
| | AC1 | 継続的統合の pytest ジョブが `-n auto` で走り、全件合格する | Pull Request の `pytest` の検査 | | ||
| | AC2 | 全体テストを案内するコマンドがすべて並列の形になっている | `grep -rn "pytest scripts/tests plugins/ndf -q\|pytest \. -q"`(`issues/` と記録の文書を除く) | | ||
| | AC3 | 手元の並列実行(`-n 4`)で全件合格し、変更前の順の実行より速い | 前後の所要を実測して PR 本文へ載せる | | ||
| | AC4 | 継続的統合の所要が変更前(テスト 5 分 30 秒)の半分以下 | Pull Request の実行時間 | | ||
| | AC5 | 寄せた競合試験が、臨界区間の重なりを変更後も失敗として検出する | `ndf_lock_acquire` の排他を外した状態で `test_many_at_once_never_share_the_critical_section` が落ちることを 1 度確かめる | | ||
| | AC6 | 減らした繰り返しのテストが、見ている不具合を変更後も検出する | 同上の手順で、対象の排他を外すと落ちることを確かめる | | ||
| | AC7 | `release/**` からの Pull Request で `Python tests` が 1 回だけ起動する | `on.push.branches` に `release/**` が無い | | ||
| | AC8 | 分割しても ruleset の必須の検査 `pytest` が 1 つの結果として返り、ruleset を変えずにマージできる | Pull Request の検査の一覧で `pytest` が合格し、マージ可能になる | | ||
|
|
||
| #884 の受け入れ条件「0.5 秒以上のテストの合計が 40 秒以下」は、この変更だけでは満たさない。 | ||
| 残る大口(`test_git_facts.py` 21 秒・`test_bg_wait.py` 19 秒・ロックの上限を待つテスト)は | ||
| 本番のスクリプトの変更を要するため、#884 は開いたまま残し、残りを本文へ記録する。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.