Description
The test fails on 1945-09-14 23:30:00.0. The failure can be reproduced by modifying the test:
test("optimization of micros rebasing - Julian to Gregorian") { outstandingZoneIds.filter(_.getId.contains("Hong"))foreach { zid => withClue(s"zone id = $zid") { withDefaultTimeZone(zid) { val start = rebaseGregorianToJulianMicros( instantToMicros(LocalDateTime.of(1, 1, 1, 0, 0, 0).atZone(zid).toInstant)) val end = rebaseGregorianToJulianMicros( instantToMicros(LocalDateTime.of(2100, 1, 1, 0, 0, 0).atZone(zid).toInstant)) var micros = -761211000000000L do { val rebased = rebaseJulianToGregorianMicros(zid, micros) val rebasedAndOptimized = rebaseJulianToGregorianMicros(micros) assert(rebasedAndOptimized === rebased) micros += (MICROS_PER_DAY * 30 * (0.5 + Math.random())).toLong } while (micros <= end) } } } }
zone id = Asia/Hong_Kong -761211000000000 did not equal -761207400000000 ScalaTestFailureLocation: org.apache.spark.sql.catalyst.util.RebaseDateTimeSuite at (RebaseDateTimeSuite.scala:236) Expected :-761207400000000 Actual :zone id = Asia/Hong_Kong -761211000000000