[ 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 line {noformat} final FileStatus status2 = dfs.getFileStatus(testDir1); {noformat} 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 (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org