[ https://issues.apache.org/jira/browse/YARN-5622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15516793#comment-15516793 ]
Eric Badger commented on YARN-5622: ----------------------------------- [~ajisakaa], it doesn't currently fail in trunk because the dateFormat used in this test is currently consistent with the format defined in Times.format(). But we aren't testing that the date format is one way or the other, we're just checking to make sure that the dates are consistent. It's unnecessary to maintain the consistency between this test's hardcoded dateFormat and the one defined in Times. So we could mark this as an improvement rather than a bug fix as the test is not actually failing at this moment. But the improvement is still valid. Currently in trunk: TestYarnCLI.java {noformat} 303 DateFormat dateFormat=new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy"); {noformat} Times.java {noformat} 33 static final ThreadLocal<SimpleDateFormat> dateFormat = 34 new ThreadLocal<SimpleDateFormat>() { 35 @Override protected SimpleDateFormat initialValue() { 36 return new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy"); 37 } 38 }; {noformat} > TestYarnCLI.testGetContainers fails due to mismatched date formats > ------------------------------------------------------------------ > > Key: YARN-5622 > URL: https://issues.apache.org/jira/browse/YARN-5622 > Project: Hadoop YARN > Issue Type: Bug > Reporter: Eric Badger > Assignee: Eric Badger > Attachments: YARN-5622.001.patch > > > ApplicationCLI.listContainers uses Times.format to print timestamps, while > TestYarnCLI.testGetContainers formats them using dateFormat.format with its > own defined format. The test should be consistent and use Times.format. > {noformat} > org.junit.ComparisonFailure: expected:<...1234_0005_01_000001 [Thu Jan 01 > 00:00:01 +0000 1970 Thu Jan 01 00:00:05 +0000 1970 COMPLETE > host:1234 http://host:2345 > logURL > container_1234_0005_01_000002 Thu Jan 01 00:00:01 +0000 1970 Thu Jan > 01 00:00:05 +0000 1970 COMPLETE host:1234 > http://host:2345 logURL > container_1234_0005_01_000003 Thu Jan 01 00:00:01 +0000 1970] > N/...> but was:<...1234_0005_01_000001 [ 1-Jan-1970 00:00:01 > 1-Jan-1970 00:00:05 COMPLETE host:1234 > http://host:2345 logURL > container_1234_0005_01_000002 1-Jan-1970 00:00:01 1-Jan-1970 > 00:00:05 COMPLETE host:1234 > http://host:2345 logURL > container_1234_0005_01_000003 1-Jan-1970 00:00:01] > N/...> > at org.junit.Assert.assertEquals(Assert.java:115) > at org.junit.Assert.assertEquals(Assert.java:144) > at > org.apache.hadoop.yarn.client.cli.TestYarnCLI.testGetContainers(TestYarnCLI.java:330) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org