Repository navigation
#630 [test] runner cleanup の終了順序と孫プロセス消滅を直接確認する - #639
Merged
Merged
Conversation
… before cleanup timing Replace the whole-run 5s wall-clock assertion in dev_server_cleanup_kills_grandchild_process_group_without_pipe_deadlock with signals bound to this run: the fake grandchild holds a named pipe open and announces readiness on it. The injected cleanup_fn (the existing run_nextjs_dev_route_probe_with_runtime hook) waits for that readiness, then measures only the cleanup interval against the cleanup's own term+kill bound. Cleanup completion, pipe EOF, and process-group ESRCH are asserted separately, so a change that skips cleanup or leaves the grandchild is detected. The duplicated dev_server_lifecycle event lookup moves to a shared helper, and the test workspace moves under the cargo target directory. 読み替え: 「pipe の EOF」は実 child/grandchild が保持する名前付きパイプ (FIFO) の write 端が閉じることと読んだ。production は child の stdout を file へ向けるため、既存の cleanup_fn 注入点の内側で当該実行の pipe を観測できる経路は FIFO だけである。 判断: cleanup 区間の上限は既存の DEV_SERVER_CLEANUP_TERM_TIMEOUT + DEV_SERVER_CLEANUP_KILL_TIMEOUT (=6s) を inclusive に使った。テストの一時ディレクトリは読み取り許可プレフィックスの下に置かず、test 実行ファイル配下(target)に作った。 本文に無い指摘: 全工程の 5 秒 assertion は起動待ちを cleanup の遅さとして扱っていたため削除し、cleanup 自体の上限と deadlock 検出(bounded な pipe 読み)に置き換えた。単純削除はしていない。 Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Use a test-side CLEANUP_INTERVAL_BOUND (5s) and a strict `< 5s` comparison instead of the product term+kill sum, so the rewritten assertion is equal to or stricter than the original whole-run 5s bound (the cleanup interval is a subset of the whole run). The message states that a cleanup which only ends after the KILL fallback also fails. Other assertions are unchanged. 判断: 「cleanup 自体の既存上限」は元の全工程 5 秒 assertion と同じ 5 秒をテスト側の名前つき定数で持つと解釈した(製品の定数の和には依存しない)。 Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…issue-630-test-runner-cleanup
3 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
概要
runner の dev server の cleanup のテスト(
dev_server_cleanup_kills_grandchild_process_group_without_pipe_deadlock)は、起動から probe・cleanup までの全体を 5 秒で測っていたため、起動待ちが cleanup の遅さとして扱われることがありました(#541 の分割 H)。この PR は、子と孫の起動完了を合図で確かめてから cleanup の区間だけを測り、cleanup の完了、pipe の EOF、process group の消滅を別々に確かめます。変更(テストのみ、対象 2 ファイル)
src/planner/runner/tests/acceptance_boundary_tests.rs:cleanup_fnの注入点に、孫の ready を(上限 5 秒で)読んでから cleanup の区間だけを測る関数を渡す。<で比較)。区間は全工程の一部なので、元と同じか厳しい。TERM で終わらず KILL に頼る cleanup は 5 秒を超えて落ちる。src/planner/runner/tests/support/process.rs:重複していた lifecycle イベントの検索をdev_server_lifecycle_eventにまとめた。tests/generality_guardrails.rsは変えていません。テストの数(#[test]25)も同じです。検証
commandmate verifyの 15 ゲート:develope5c6a37cを取り込んだ HEAD で 15/15 pass(af6824b6、scope 2 本、違反 0)。cargo test --test generality_guardrails:取り込んだ HEAD で exit 0、10 passed・0 failed。行数(generality_guardrails の数え方):acceptance_boundary_tests.rs 1350(上限 1,367)、support/process.rs 103(上限 106)、runner のテストの総量 15507(上限 15,511)process group … should be gone)。grandchild pipe must reach EOF once the grandchild is reaped。process group の確認は通り、FIFO の EOF の確認だけが検出した)。cleanup that needs the KILL fallback (SIGTERM not enough) exceeds 5s: 5110ms)。レビュー
テストだけの変更です。merge 前レビューは行いません(利用者承認済み)。
Refs #630
Refs #541
🤖 Generated with Claude Code