[ 
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) cannot be deleted when the test finishes.

This is because TestFileContextResolveAfs1 was always deleted before 
TestFileContextResolveAfs2 when they were both passed into 
FileSystem#deleteOnExit. This caused TestFileContextResolveAfs2 to become a 
dangling link, which FileSystem in Hadoop currently cannot delete. (This is 
because Files#exists will return false for dangling links.)

As a result, the test `testFileContextResolveAfs` only passed for the first 
run. And for later runs of this test, it will fail by throwing the following 
exception: 
{code:java}
fs.FileUtil (FileUtil.java:symLink(821)) - Command 'ln -s 
mypath/TestFileContextResolveAfs1 mypath/TestFileContextResolveAfs2' failed 1 
with: ln: mypath/TestFileContextResolveAfs2: File exists

java.io.IOException: Error 1 creating symlink 
file:mypath/TestFileContextResolveAfs2 to mypath/TestFileContextResolveAfs1
{code}

  was:
In the test testFileContextResolveAfs, the symlink TestFileContextResolveAfs2 
(linked to TestFileContextResolveAfs1) cannot be deleted when the test finishes.

This is because TestFileContextResolveAfs1 was always deleted before 
TestFileContextResolveAfs2 when they were both passed into 
FileSystem#deleteOnExit. This caused TestFileContextResolveAfs2 to become a 
dangling link, which FileSystem in Hadoop currently cannot delete. (This is 
because Files#exists will return false for dangling links.)

As a result, the test `testFileContextResolveAfs` only passed for the first 
run. And for later runs of this test, it will fail by throwing the following 
exception: 
{code:java}
java.io.IOException: Error 1 creating symlink 
file:/*/hadoop-common-project/hadoop-common/target/test/data/TestFileContextResolveAfs2
 to 
/*/hadoop-common-project/hadoop-common/target/test/data/TestFileContextResolveAfs1
{code}


> testFileContextResolveAfs creates dangling link and fails for subsequent runs
> -----------------------------------------------------------------------------
>
>                 Key: HADOOP-16971
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16971
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: common, fs, test
>    Affects Versions: 3.2.1, 3.4.0
>            Reporter: Ctest
>            Priority: Minor
>              Labels: easyfix, fs, symlink, test
>         Attachments: HADOOP-16971.000.patch
>
>
> In the test testFileContextResolveAfs, the symlink TestFileContextResolveAfs2 
> (linked to TestFileContextResolveAfs1) cannot be deleted when the test 
> finishes.
> This is because TestFileContextResolveAfs1 was always deleted before 
> TestFileContextResolveAfs2 when they were both passed into 
> FileSystem#deleteOnExit. This caused TestFileContextResolveAfs2 to become a 
> dangling link, which FileSystem in Hadoop currently cannot delete. (This is 
> because Files#exists will return false for dangling links.)
> As a result, the test `testFileContextResolveAfs` only passed for the first 
> run. And for later runs of this test, it will fail by throwing the following 
> exception: 
> {code:java}
> fs.FileUtil (FileUtil.java:symLink(821)) - Command 'ln -s 
> mypath/TestFileContextResolveAfs1 mypath/TestFileContextResolveAfs2' failed 1 
> with: ln: mypath/TestFileContextResolveAfs2: File exists
> java.io.IOException: Error 1 creating symlink 
> file:mypath/TestFileContextResolveAfs2 to mypath/TestFileContextResolveAfs1
> {code}



--
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