[ https://issues.apache.org/jira/browse/HDFS-10934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15537138#comment-15537138 ]
Mingliang Liu commented on HDFS-10934: -------------------------------------- What I proposed is some code snippet liket: {code} diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java index fc90db5..558bcda 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java @@ -2127,11 +2127,11 @@ public void testStat() throws Exception { fmt.setTimeZone(TimeZone.getTimeZone("UTC")); final Path testDir1 = new Path("testStat", "dir1"); dfs.mkdirs(testDir1); - final FileStatus status1 = dfs.getFileStatus(testDir1); - final String mtime1 = fmt.format(new Date(status1.getModificationTime())); final Path testFile2 = new Path(testDir1, "file2"); DFSTestUtil.createFile(dfs, testFile2, 2 * blockSize, (short) 3, 0); - final FileStatus status2 = dfs.getFileStatus(testDir1); + final FileStatus status1 = dfs.getFileStatus(testDir1); + final String mtime1 = fmt.format(new Date(status1.getModificationTime())); + final FileStatus status2 = dfs.getFileStatus(testFile2); final String mtime2 = fmt.format(new Date(status2.getModificationTime())); final ByteArrayOutputStream out = new ByteArrayOutputStream(); {code} Do you think it makes sense or do you provide a similar patch? Thanks. > 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