Repository navigation
Fix flaky parallel CI: isolate published files per test process - #2
Merged
Merged
Conversation
The grant:install test published config/grant.php into the shared Testbench skeleton and deleted it afterwards. Under pest --parallel, another worker could list the skeleton's config directory while the file existed and then fail to require it once it was removed. Point app, config, and database paths at a per-process temp directory so publishing never touches the shared skeleton. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li5c15yQmNGe1f2jZpMv5W
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.
What does this PR do?
This PR fixes an intermittent failure in the Tests workflow, first seen on run 36550334572 (
P8.3 - L12.* - prefer-stable - ubuntu-latest):Root cause: the
grant:installtest publishesconfig/grant.phpinto the shared Testbench skeleton and deletes it in itsfinallyblock.composer test:unitrunspest --parallel. If another worker boots its app while the file exists,LoadConfigurationlists it, and the worker then fails torequireit once the install test has removed it. Whether a run hits this depends on test order, so identical code can pass in one run and fail in the next.Fix:
TestCase::defineEnvironment()runs before providers boot. It now points the app, config and database paths at a per-process temp directory, so publishing never writes to the shared skeleton. The install test also asserts that the skeleton's config directory is left untouched.Type of change
Checklist
composer lintpasses (Pint and Rector are clean undercomposer test:lint)composer testpasses, and 8 consecutivepest --parallelruns passed locally with nogrant.phpleft in the skeleton🤖 Generated with Claude Code
https://claude.ai/code/session_01Li5c15yQmNGe1f2jZpMv5W
Generated by Claude Code