aajisaka commented on code in PR #4242: URL: https://github.com/apache/hadoop/pull/4242#discussion_r860997327
########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestTimes.java: ########## @@ -61,4 +67,15 @@ public void testFinishTimesAheadOfStartTimes() { elapsed = Times.elapsed(Long.MAX_VALUE, 0, true); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); } + + @Test + public void validateISO() throws IOException { + SimpleDateFormat isoFormat = new SimpleDateFormat(ISO8601_DATE_FORMAT); + for (int i = 0; i < 1000; i++) { + long now = System.currentTimeMillis(); + String instant = Times.formatISO8601(now); + String date = isoFormat.format(new Date(now)); + Assert.assertEquals(date, instant); Review Comment: Thank you @jteagles. > isoFormat is using the old method of calculating the date and instant is being checked against isoFormat to ensure the same result has been achieved after the change. +1, thank you for your explanation. Sorry my comment was wrong. Current implementation (old/expected, new/actual) seems correct. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org