[
https://issues.apache.org/jira/browse/HADOOP-7326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038815#comment-13038815
]
Matt Foley commented on HADOOP-7326:
------------------------------------
Hi Todd,
bq. Rather than making CHECKPOINT public, can you add a new method like
Trash.isCheckpointFileName(String)?
I'd prefer not to create this new API, for the following reasons:
* CHECKPOINT isn't public, it's protected, which is common practice in the
Hadoop codebase for exposing internal stuff to unit tests.
* It's a static final constant, so there's no harm in exposing it.
* I only want to test the basename, not the whole path, so claiming
"isCheckpointFileName" is larger scope than needed.
* There's no other demand for a test for "isCheckpointBasename", as shown by
the fact that it doesn't already exist.
bq. It's still not clear why TestHDFSTrash was putting stuff in the local
filesystem's .Trash folder. There are two things wrong there - 1) TestHDFSTrash
is supposed to test HDFS, not local...
Completely agree, so I've copied your comment into HDFS-1967, which deals with
TestHDFSTrash. If you can help me understand what TestHDFSTrash thinks it's
doing, and whether it accomplishes it, I'd appreciate it. (I think it's trying
to do exactly equivalent tests on Local FileSystem with TestTrash and HDFS
FileSystem with TestHDFSTrash, but it doesn't seem to be succeeding.)
bq. ...and 2) it seems [it should] try to set up the .Trash dir inside build/
so that different builds dont interact poorly.
Yah, this is a weird one. I'm told that Trash is a fairly old feature, and was
deliberately set up so that on local filesystems it would use the local
canonical Trash. Not what I would have chosen, but changing would require not
just a change to the unit test, but a large change to the semantics of Trash.
Please let me know if you can +1 this patch on the basis of these responses.
Thanks.
> TestTrash.testTrashEmptier() infinite loops if run on a home directory with
> stuff in .Trash
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-7326
> URL: https://issues.apache.org/jira/browse/HADOOP-7326
> Project: Hadoop Common
> Issue Type: Bug
> Components: test
> Affects Versions: 0.22.0, 0.23.0
> Reporter: Matt Foley
> Assignee: Matt Foley
> Attachments: hadoop-7326-TestTrash-1.patch
>
>
> This bug was discovered while investigating HDFS-1967, intermittent failure
> of TestHDFSTrash, which calls TestTrash. If the user id running the test has
> a ~/.Trash directory that already has 4 or more files in it, a loop in
> TestTrash.testTrashEmptier() will never terminate, because it is waiting for
> the count of objects to increase from zero to exactly three (and it creates
> one object right away).
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira