[ 
https://issues.apache.org/jira/browse/IO-725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17322890#comment-17322890
 ] 

Peter Stegemann commented on IO-725:
------------------------------------

I ran into this problem on a Linux machine (failed to delete a directory tree 
with a symbolic link in it), so I cloned common-io from github and tried to 
build it on my worker machine with Windows and I get the same test failure:
{noformat}
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   
FileUtilsDeleteDirectoryWindowsTestCase>FileUtilsDeleteDirectoryBaseTestCase.testDeleteDirWithASymlinkDir:58
 expected: <true> but was: <false>
[ERROR]   
FileUtilsDeleteDirectoryWindowsTestCase>FileUtilsDeleteDirectoryBaseTestCase.testDeleteDirWithSymlinkFile:118
 expected: <true> but was: <false> [ERROR]   
FileUtilsDeleteDirectoryWindowsTestCase>FileUtilsDeleteDirectoryBaseTestCase.testDeleteParentSymlink:173
 expected: <true> but was: <false>
[ERROR] Errors:
[ERROR]   
FileUtilsDeleteDirectoryWindowsTestCase>FileUtilsDeleteDirectoryBaseTestCase.testDeleteDirWithASymlinkDir2:89
 » FileSystem
[ERROR]   
FileUtilsDeleteDirectoryWindowsTestCase>FileUtilsDeleteDirectoryBaseTestCase.testDeleteInvalidLinks:145
 » FileSystem
[ERROR]   
FileUtilsDeleteDirectoryWindowsTestCase>FileUtilsDeleteDirectoryBaseTestCase.testDeleteParentSymlink2:206
 » FileSystem
[INFO]
[ERROR] Tests run: 1838, Failures: 3, Errors: 3, Skipped: 7{noformat}
And
{noformat}
[INFO] Running org.apache.commons.io.FileUtilsDeleteDirectoryWindowsTestCase 
You do not have sufficient privilege to perform this operation. You do not have 
sufficient privilege to perform this operation. You do not have sufficient 
privilege to perform this operation. [ERROR] Tests run: 8, Failures: 3, Errors: 
3, Skipped: 0, Time elapsed: 0.521 s <<< FAILURE! - in 
org.apache.commons.io.FileUtilsDeleteDirectoryWindowsTestCase [ERROR] 
org.apache.commons.io.FileUtilsDeleteDirectoryWindowsTestCase.testDeleteDirWithSymlinkFile
 Time elapsed: 0.097 s <<< FAILURE! org.opentest4j.AssertionFailedError: 
expected: <true> but was: <false>[ERROR] 
org.apache.commons.io.FileUtilsDeleteDirectoryWindowsTestCase.testDeleteDirWithASymlinkDir
 Time elapsed: 0.07 s <<< FAILURE! org.opentest4j.AssertionFailedError: 
expected: <true> but was: <false>[ERROR] 
org.apache.commons.io.FileUtilsDeleteDirectoryWindowsTestCase.testDeleteParentSymlink
 Time elapsed: 0.073 s <<< FAILURE! org.opentest4j.AssertionFailedError: 
expected: <true> but was: <false>[ERROR] 
org.apache.commons.io.FileUtilsDeleteDirectoryWindowsTestCase.testDeleteDirWithASymlinkDir2
 Time elapsed: 0.014 s <<< ERROR! java.nio.file.FileSystemException: 
C:\Users\tk8tp\AppData\Local\Temp\1\junit11731283517145142303\realouter\fakeinner:
 A required privilege is not held by the client[ERROR] 
org.apache.commons.io.FileUtilsDeleteDirectoryWindowsTestCase.testDeleteParentSymlink2
 Time elapsed: 0.011 s <<< ERROR! java.nio.file.FileSystemException: 
C:\Users\tk8tp\AppData\Local\Temp\1\junit5595263196221862300\realparent\fakeinner:
 A required privilege is not held by the client[ERROR] 
org.apache.commons.io.FileUtilsDeleteDirectoryWindowsTestCase.testDeleteInvalidLinks
 Time elapsed: 0.008 s <<< ERROR! java.nio.file.FileSystemException: 
C:\Users\tk8tp\AppData\Local\Temp\1\junit4377526187746864700\realParentDirA\realChildDirB\linkToC:
 A required privilege is not held by the client
{noformat}
So the issue is definitely not only for MacOS. My current best guess is that in 
FileUtils.deleteFile() it calls Files.size() on the symlink and that is what 
fails.

I still have to try this on Linux.

> FileUtilsDeleteDirectoryLinuxTestCase fails on Mac
> --------------------------------------------------
>
>                 Key: IO-725
>                 URL: https://issues.apache.org/jira/browse/IO-725
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>         Environment: MacOS Version 11.2.3 (Big Sur) on Java 11.0.9 Maven 3.6.3
> MacOS Version 10.14.6 (Mojave) on Java 15.0.2 Maven 3.6.1
>            Reporter: Brian Zou
>            Priority: Minor
>         Attachments: Text-Log.txt
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> After cloning the repository using the command line and running the code on a 
> MacBook Pro there is one test error, as shown below.
> {code:java}
> -------------------------------------------------------------------------------
> Test set: org.apache.commons.io.FileUtilsDeleteDirectoryLinuxTestCase
> -------------------------------------------------------------------------------
> Tests run: 10, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.175 s <<< 
> FAILURE! - in org.apache.commons.io.FileUtilsDeleteDirectoryLinuxTestCase
> org.apache.commons.io.FileUtilsDeleteDirectoryLinuxTestCase.testDeleteInvalidLinks
>   Time elapsed: 0.004 s  <<< ERROR!
> org.apache.commons.io.IOExceptionList: 
> /var/folders/zz/szdyqxvs5lg94f9ffy016bsr0000gn/T/junit12436802239416119036/realParentDirC
> Caused by: java.io.IOException: Cannot delete file: 
> /var/folders/zz/szdyqxvs5lg94f9ffy016bsr0000gn/T/junit12436802239416119036/realParentDirC/realChildDirD
> Caused by: java.nio.file.AccessDeniedException: 
> /var/folders/zz/szdyqxvs5lg94f9ffy016bsr0000gn/T/junit12436802239416119036/realParentDirC/realChildDirD
> {code}
> This error was also reproduced in an iMac. The pom.xml version is the 
> 2.9.0-SNAPSHOT, which comes from the GitHub repository here: [Apache 
> Commons-io pom.xml|https://github.com/apache/commons-io/blob/master/pom.xml] 
> The logs are attached below as a txt attachment.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to