Repository navigation
fix(warmup): weave the enumerated files in path order - #805
Merged
Merged
Conversation
…dependent In-process warm-up walks the files in the order the file system lists them, which is not sorted. With the valid src/Some.php from setUp() next to the two broken files, a listing that put Some.php first made the warmer process it, fail on the next file and stop: "Total processed 2" instead of 1. That is what failed the coverage job in #788. The test now removes the valid file, so only the two broken files remain and the warmer processes exactly one of them, whichever is listed first. It also asserts that only one file failed, i.e. the second broken file was skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxhC1F17fBJcmZzT44WKzi
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #805 +/- ##
============================================
+ Coverage 98.49% 98.54% +0.05%
- Complexity 2090 2115 +25
============================================
Files 127 127
Lines 5441 5500 +59
============================================
+ Hits 5359 5420 +61
+ Misses 82 80 -2 ☔ View full report in Codecov by Harness. |
lisachenko
commented
Nov 5, 2026
The file system lists a directory in any order, which differs between machines, so in-process warm-up wove the files in a different order on each CI runner. With fail-fast it then stopped on a different file: CacheWarmerTest::testFailFastStopsAfterFirstError reported "Total processed 2" whenever the valid Some.php was listed before the broken files. The warmer now sorts the collected files by path, so every run weaves them in the same order and fail-fast stops on the same file. The worker pool keeps ordering by size; its sort is stable, so files of the same size stay in path order. The test keeps all three files (the previous commit removed the valid one) and asserts which file stopped the warm-up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxhC1F17fBJcmZzT44WKzi
lisachenko
marked this pull request as ready for review
November 5, 2026 10:30
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 and why
Fixes the flaky
CacheWarmerTest::testFailFastStopsAfterFirstError, reported in #788 (comment) (it failed the coverage job there withTotal processed 2, 1 errorsinstead of1).Cause: in-process warm-up wove files in the order the file system lists them, which is not sorted (on ext4 it follows a per-file-system name hash, so it differs between CI runners). The test has the valid
src/Some.phpfromsetUp()plusBroken.phpandAlsoBroken.php. WhenSome.phpwas listed first, the warmer processed it, failed on the next file and stopped, so it reported 2 processed files.Fix:
CacheWarmer::weaveApplication()sorts the collected files by path. Every run now weaves them in the same order on any machine, and fail-fast stops on the same file. The worker pool still orders by size;usortis stable, so files of the same size stay in path order. The test keeps all three files and asserts thatAlsoBroken.phpstopped the warm-up andBroken.phpwas never processed.Verification:
OSome.php): the test fails against the old warmer and passes with the sort.CacheWarmerTestpass; php-cs-fixer reports nothing on the changed files.Checklist
type(scope): summary)composer checkpasses — not run in full: PHPStan couldn't be downloaded in the sandbox, and 56 functional tests crash there with a segfault (signal 11) in child PHP processes, with and without this change; left to CI🤖 Generated with Claude Code
https://claude.ai/code/session_01FxhC1F17fBJcmZzT44WKzi