Mark buildFromIterator test as conflicting #11869
Closed
+2
−0
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.
Commit 0b2e6bc started caching the directory entry type to improve performance. Shortly after, we've seen flaky failures of the buildFromIterator phar test.
When it fails, it's always a value error in the constructor of RecursiveDirectoryIterator::__construct() with a "no such file or directory" error. What's happening here is this:
returns "yes" on the subdirectory.
because the directory is gone.
This race has always been possible, even before said commit. It's just that it was very hard to hit before: the expensive stat call made the race window hard to hit. The race is now easier to hit because of the caching that is fast.
Since there's many tests that modify the current working directory, it seems best to mark this as an "all" conflict. We cannot avoid every TOC-TOU race when working with files with these phar tests.
In particular, mounteddir.phpt caused every conflict I saw on CI, but there's more tests that create subdirectories in the current working directory.
EDIT: I actually should've targeted 8.1, I'll do the merge manually anyway so it doesn't really matter ig 🤷