Skip to content

fix(Runner): check mkdir() return value to prevent silent failures#173

Merged
s2x merged 2 commits intomasterfrom
fix/151-runner-mkdir-return-value
Apr 30, 2026
Merged

fix(Runner): check mkdir() return value to prevent silent failures#173
s2x merged 2 commits intomasterfrom
fix/151-runner-mkdir-return-value

Conversation

@s2x
Copy link
Copy Markdown
Collaborator

@s2x s2x commented Apr 30, 2026

Closes #151

Checks the return value of mkdir() in Runner::run() and throws a clear \RuntimeException on failure. The double is_dir() check handles the race condition where another process may create the directory between the initial check and the mkdir() call.

@s2x
Copy link
Copy Markdown
Collaborator Author

s2x commented Apr 30, 2026

Code Review

Warnings

  1. Missing test for mkdir() failure path
    The project uses structural tests in RunnerTest.php to verify error-handling patterns (e.g., testRunnerUsesCorrectForkErrorHandling). The new mkdir() failure branch should have a matching assertion to prevent regression and maintain consistency with the existing test strategy.

  2. Missing CHANGELOG entry
    The [Unreleased] section is currently empty. Per CONTRIBUTING.md, please add a Fixed entry under [Unreleased] following the Keep a Changelog format.

Nits

  1. Inconsistent sprintf namespacing
    The new code uses sprintf() without the leading backslash, while existing line 71 uses \sprintf(). Please use \sprintf() for consistency with the rest of the file.

PR Health: CI passing | Not draft | Awaiting approval

- Use \sprintf() for consistency with rest of file
- Add structural test for mkdir() failure path
- Add CHANGELOG entry under [Unreleased]
@s2x s2x merged commit 35352f8 into master Apr 30, 2026
22 checks passed
@s2x s2x deleted the fix/151-runner-mkdir-return-value branch April 30, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runner::run() — mkdir() return value not checked

1 participant