jteagles commented on code in PR #4242:
URL: https://github.com/apache/hadoop/pull/4242#discussion_r860986710
##########
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:
Thanks for the quick reply, @aajisaka. Double checking on this one, since
expected and actual are a bit confusing to me in this case. 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. I can
see it either way. If you confirm, I will make the change you suggested.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]