Add characterization test for copying a symlinked directory#570
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #570 +/- ##
=========================================
Coverage 85.99% 85.99%
Complexity 3497 3497
=========================================
Files 231 231
Lines 8253 8253
Branches 964 964
=========================================
Hits 7097 7097
Misses 866 866
Partials 290 290 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Interesting: Adding these two tests add 4 seconds to running |
asfgit
pushed a commit
that referenced
this pull request
Jan 27, 2024
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.
See what happens when copyDirectory copies a directory that is a symlink to another directory containing non-symlinked files. This is a characterization test to explore current behavior, and arguably represents a bug. This behavior, and the test, is likely to change and should not be relied on.
FYI the second test added here that creates a symlink cycle would have exposed a bug that exists in the most recent release. (I rolled back a couple of months and the test failed then but not now) That bug was fixed by copying symlinks as symlinks rather than by following the links. If we decide to revert to the old follow links behavior, we will need to figure out what we want to do about symlink cycles like this.
@garydgregory @eamonnmcmanus
This is from the test as it fails in the release. At least it doesn't infinitely loop. It's a little worrisome that I can't explain why it loops for a while and then stops. It might be hitting an OS level MAXSYMLINKS limit or a maximum path length.
java.io.FileNotFoundException: Source '/var/folders/nj/33bhgzxj5zb8xtzb5tfh_9y40000gn/T/junit4465446543506135552/FileUtilsTest5790156993778646647/topDirectory/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top/child_directory/link_to_top' does not exist at org.apache.commons.io.FileUtils.checkFileExists(FileUtils.java:300) at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:829) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1333) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1331) at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:713) at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:644) at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:545) at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:516) at org.apache.commons.io.FileUtilsTest.testCopyDir_symLinkCycle(FileUtilsTest.java:433) at java.lang.reflect.Method.invoke(Method.java:498) at java.util.ArrayList.forEach(ArrayList.java:1257) at java.util.ArrayList.forEach(ArrayList.java:1257)