Skip to content

全体テスト: 手元と PR の CI の両方で 3 分以内に終わり、打ち切ってもプロセスを残さない(#2291) - #2304

Merged
takemi-ohama merged 4 commits into
developfrom
design/issue-2291
Oct 31, 2026
Merged

takemi-ohama merged 4 commits into
developfrom
design/issue-2291

Conversation

@takemi-ohama

Copy link
Copy Markdown
Contributor

#2291 の設計文書として、全体テストを 3 分以内で終わらせ、途中で打ち切っても子プロセスを残さないための設計を issues/issue-2291-design.md に書きました。あわせて、要求と受け入れ条件の写しを issues/issue-2291-requirements.md に置きました。

利用者向けの変化

  • 無し

移行の手順

  • 無し

変更の要点

テスト

supervise.py の run のステップの結果です。

ステップ exit 結果
glossary 0 ok(宣言と用語集が揃っている)
requirements-check 2 stopped(issues/issue-2291-requirements.md を読めない: No such file)

requirements-check は止まっています。要求の写し issues/issue-2291-requirements.md はこの PR で追加していますが、このステップはそのファイルを読めませんでした。マージの前に、このステップを通す必要があります。

モード: standard / 通した工程: 設計 → 要求と受け入れ条件 → ドキュメントレビュー

🤖 Generated with Claude Code

決めたこと

issues/issue-2291-design.md

  • 決定 1: 3 分に入る道筋を先に数で持つため、suite ごとに秒の予算を割り、pytest は各テストの所要の合計を約 460 秒へ減らす
  • 決定 2: テストを書く側が後から当てられるよう、削る基準を 6 つにして docs/plugin-development-guide.md に置く
  • 決定 3: 確かめる振る舞いを弱めずに速くするため、手段を 3 つに絞り、テストの対象のコードは変えない
  • 決定 4: NDF を通さない打ち切りでも子を残さないため、後始末を根の conftest が読む部品に置き、pytest の各プロセスを子の回収役にする
  • 決定 5: 同じ PR で古い CI の実行を進めないため、Python tests に PR の番号ごとの concurrency を置き、集約のジョブの判定は変えない
  • 決定 6: CI の準備を縮めるため、uv をキャッシュつきで入れ、分割の数 2 は変えない
  • 決定 7: 着手前後を同じ手順で測るため、計測を実験版のスクリプトにし、台帳を PR 本文の外のファイルに置く

takemi-ohama and others added 2 commits October 31, 2026 13:32
削る基準 6 つ・suite ごとの秒の予算・速くする 3 つの手段・pytest の各プロセスを子の回収役にする後始末・
PR ごとの CI の取り消しを決める。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 1 | codex | APPROVE

今回のレビュー範囲で critical / major の指摘はありません。判断の根拠: Value 1・Value 7・Value 8・Value 10。

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 1 | kiro | APPROVE

ドメインモデルの節と用語集の差分を見た。集約ごとに持ち主が 1 つに決まり、ドメインイベント E1〜E8 は要求の番号を 1:1 で引き継ぎ全件に受け手があり、不変条件どうしの矛盾は無い。用語の表は 3 語とも『変更なし』で用語集と一致し、足す・意味を変える・廃止する語が無いため用語集の差分が無いのは妥当。critical / major に当たる指摘は無い。

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 2 | claude | REQUEST_CHANGES

後始末の部品(決定 4)は、子の回収役にしたことで生まれるゾンビの回収と、stop_tree を自分自身へ向けない呼び方が設計に無い。決定 5 の concurrency の組では main / develop の push も取り消される。この 3 点を設計に書き足す。

Comment thread issues/issue-2291-design.md Resolved
Comment thread issues/issue-2291-design.md Resolved
Comment thread issues/issue-2291-design.md Resolved

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 2 | kiro | APPROVE

設計と要求の 2 文書を差分の全行で確認した。設計が断定する外部コマンドの挙動(test_triage.stop_group と refactor_lib.process.run_with_timeout の SIGTERM 後の猶予 5 秒、procs.py の child_pids / stop_tree、ローカル pytest suite の -n 4、CI の集約ジョブ pytest の if: always() と required-checks-check の存在)は、いずれもリポジトリの実体と一致した。決定 1 の予算の数値は未確認として E1 で置き換える扱いが明記され、受け入れ条件・設計要素・テスト設計の行も対応が取れている。critical / major に当たる修正アクションは無い。

@takemi-ohama

Copy link
Copy Markdown
Contributor Author

🔧 /ndf:fix サマリ | round 2 | commit 2499e27

対応件数: critical=0 / major=3 / minor=0(合計 3 件)
決着: 3 件 / 見送り: 0 件 / 却下: 0 件
CI: SUCCESS

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 3 | claude | REQUEST_CHANGES

決定 4 の SIGCHLD の回収は、pid を記録する前に子が終わると、自分が起こした子を「覚えの無い pid」として回収してしまう。記録と回収の判定の順序を設計に書く。

Comment thread issues/issue-2291-design.md Resolved

@takemi-ohama takemi-ohama left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 cross-review | round 3 | codex | REQUEST_CHANGES

子の起動と pid 登録の間に SIGCHLD の回収が割り込まない契約を追加してください。判断の根拠: Value 1・Value 3・Value 6。

Comment thread issues/issue-2291-design.md Resolved
@takemi-ohama

Copy link
Copy Markdown
Contributor Author

🔧 /ndf:fix サマリ | round 3 | commit 26d32ec

対応件数: critical=0 / major=2 / minor=0(合計 2 件)
決着: 2 件 / 見送り: 0 件 / 却下: 0 件
CI: SUCCESS

@takemi-ohama

Copy link
Copy Markdown
Contributor Author

🔧 /ndf:fix サマリ | commit (なし)

対応件数: critical=0 / major=0 / minor=0(合計 0 件)
決着: 0 件 / 見送り: 0 件 / 却下: 0 件
CI: NONE

@takemi-ohama
takemi-ohama marked this pull request as ready for review October 31, 2026 14:03
@takemi-ohama takemi-ohama added the design-approved 設計 Pull Request の承認の印 label Oct 31, 2026
@takemi-ohama
takemi-ohama merged commit 4c93e2f into develop Oct 31, 2026
24 checks passed
@takemi-ohama
takemi-ohama deleted the design/issue-2291 branch October 31, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design-approved 設計 Pull Request の承認の印

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant