test: cover the startup log rotation failure paths - #120
Merged
Merged
Conversation
…link test The startup rotation guard swallows every error so a run never dies on a missing or unwritable worker.log, but nothing exercised that catch. Add the two failure paths, and stop the delete-side symlink test from also tripping the rename guard. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
nonz250
force-pushed
the
sabori-flow/111-20260731231855
branch
from
August 9, 2026 06:41
3038a09 to
f9268d5
Compare
nonz250
marked this pull request as ready for review
August 9, 2026 06:44
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.
Summary
close #111
worker.logの起動時ローテーション自体は、本 PR とは別の経路で先に main へマージされました(577425c,20872a2)。そのため origin/main に rebase した結果、この PR に残るのは main 側の実装がカバーしていないテストだけになっています。Issue #111 は未クローズのため、このテスト補強をもってクローズします。Changes
ローテーション処理は「ワーカーの起動を絶対に止めない」という方針で例外をすべて握り潰しますが、その catch を通る経路にテストがありませんでした。
worker.logが存在しない初回起動時に、例外を投げずにローテーションをスキップすることを検証するテストを追加しましたworker.logのリネームガードまで巻き込んでいました。worker.logだけ通常ファイルとして扱うようモックを分離し、削除のスキップだけを検証するようにしていますChecklist
npm run buildが通ることを確認その他
サイズ閾値によるローテーションや
launchd_stderr.logへの重複出力の解消は本 Issue のスコープ外です(Issue コメントの通り別途追跡されています)。🤖 Generated with Claude Code