vasiliy-mikhailov commented on PR #38932:
URL: https://github.com/apache/shardingsphere/pull/38932#issuecomment-4821384305

   Thanks @linghengqian. The added 
`SnowflakeKeyGenerateAlgorithmTest#assertEpochShouldBeTimezoneIndependent` is 
the minimal reproducer, and it's deterministic rather than timing-based: it 
asserts the configured EPOCH equals `LocalDateTime.of(2016, 11, 1, 0, 0, 
0).toInstant(ZoneOffset.UTC).toEpochMilli()` (the fixed UTC epoch), regardless 
of the JVM default timezone. On master the EPOCH is parsed in the system 
timezone, so the test fails whenever the default zone isn't UTC (e.g. 
`-Duser.timezone=America/New_York`); with the fix it passes in any zone. Since 
it compares the computed epoch constant, not clock skew, it doesn't need a 
`max-tolerate-time-difference-milliseconds` tolerance. CI (checkstyle) is fixed 
now too.


-- 
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]

Reply via email to