hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Badger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-10934) TestDFSShell.testStat fails intermittently
Date Fri, 30 Sep 2016 20:57:20 GMT

    [ https://issues.apache.org/jira/browse/HDFS-10934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15537047#comment-15537047

Eric Badger commented on HDFS-10934:

bq. I then realized that perhaps I should not rely on the assumption mtime1 == mtime2 in the
first place.

[~liuml07], if I'm reading the test correctly, the test never checks that {{mtime1 == mtime2}}.
It calls {{doFsStat()}} on both the file and directory, but checks the directory time against
mtime1 and then the file against mtime2. I agree that the file status and directory status
are generally free to be different, which is why I kept the file open so that they would be
equal in this case (file created in directory, no other operations). It was slightly peculiar
to me that we were testing the modification time of the directory (mtime2) against the modification
time of the file, but it works in this contrived case. 

The easier way to fix this test would be to change {{testDir1}} to {{testFile2}} in the following
final FileStatus status2 = dfs.getFileStatus(testDir1);

It no longer tests that the directory gets modified when a file is created, but I don't believe
that is the goal of this test. 

> TestDFSShell.testStat fails intermittently
> ------------------------------------------
>                 Key: HDFS-10934
>                 URL: https://issues.apache.org/jira/browse/HDFS-10934
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: test
>            Reporter: Eric Badger
>            Assignee: Eric Badger
>         Attachments: HDFS-10934.001.patch
> Saw this failure in an internal build. Reran the test 30 times and it failed once with
the same type of failure. 
> {noformat}
> org.junit.ComparisonFailure: Unexpected -stat output: 2016-09-30 03:48:56
> 2016-09-30 03:48:57
>  expected:<...6
> 2016-09-30 03:48:5[7]
> > but was:<...6
> 2016-09-30 03:48:5[6]
> >
> 	at org.junit.Assert.assertEquals(Assert.java:115)
> 	at org.apache.hadoop.hdfs.TestDFSShell.testStat(TestDFSShell.java:2082)
> {noformat}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org

View raw message