[ 
https://issues.apache.org/jira/browse/HADOOP-16971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ctest updated HADOOP-16971:
---------------------------
    Description: 
In the test `testFileContextResolveAfs`, the symlink 
`TestFileContextResolveAfs2` (linked to `TestFileContextResolveAfs1`) was not 
deleted as intended in the first run, thus the test will fail in the second run.

The reason is that this test uses org.apache.hadoop.fs.FileSystem to handle the 
deletion of symlink, which

1. does not support symlink.
 2. deletes `TestFileContextResolveAfs1` before `TestFileContextResolveAfs2` if 
both links passed into `deleteOnExit`. This is because of in paths in the set 
`deleteOnExit`, `TestFileContextResolveAfs1` will always be deleted before 
`TestFileContextResolveAfs2`, due to TreeSet property.

When `TestFileContextResolveAfs1` has been deleted, 
`TestFileContextResolveAfs2` became an orphan symlink and is considered as a 
non-exisitent path by org.apache.hadoop.fs.FileSystem#exists, thus its deletion 
cannot be completed. 

When the test is run for the second time, it will fail with IOException because 
`TestFileContextResolveAfs2` has been created.

 

  was:
In the test `testFileContextResolveAfs`, the symlink 
`TestFileContextResolveAfs2` (linked to `TestFileContextResolveAfs1`) was not 
deleted as intended in the first run, thus the test will fail in the second run.


The reason is that this test uses org.apache.hadoop.fs.FileSystem to handle the 
deletion of symlink, which

1. does not support symlink.
2. deletes `TestFileContextResolveAfs1` before `TestFileContextResolveAfs2` if 
both links passed into `deleteOnExit` in any order, because of the ordering of 
paths to be deleted in the TreeSet `deleteOnExit`.


When `TestFileContextResolveAfs1` has been deleted, 
`TestFileContextResolveAfs2` became an orphan symlink and is now considered as 
a non-exisitent path by org.apache.hadoop.fs.FileSystem, thus its deletion 
cannot be completed.

 


> testFileContextResolveAfs failed to delete created symlink and pollute 
> subsequent test run.
> -------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-16971
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16971
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: common, test
>    Affects Versions: 3.2.1, 3.4.0
>            Reporter: Ctest
>            Priority: Minor
>              Labels: easyfix
>         Attachments: HADOOP-16971.000.patch
>
>
> In the test `testFileContextResolveAfs`, the symlink 
> `TestFileContextResolveAfs2` (linked to `TestFileContextResolveAfs1`) was not 
> deleted as intended in the first run, thus the test will fail in the second 
> run.
> The reason is that this test uses org.apache.hadoop.fs.FileSystem to handle 
> the deletion of symlink, which
> 1. does not support symlink.
>  2. deletes `TestFileContextResolveAfs1` before `TestFileContextResolveAfs2` 
> if both links passed into `deleteOnExit`. This is because of in paths in the 
> set `deleteOnExit`, `TestFileContextResolveAfs1` will always be deleted 
> before `TestFileContextResolveAfs2`, due to TreeSet property.
> When `TestFileContextResolveAfs1` has been deleted, 
> `TestFileContextResolveAfs2` became an orphan symlink and is considered as a 
> non-exisitent path by org.apache.hadoop.fs.FileSystem#exists, thus its 
> deletion cannot be completed. 
> When the test is run for the second time, it will fail with IOException 
> because `TestFileContextResolveAfs2` has been created.
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to