[
https://issues.apache.org/jira/browse/KYLIN-5519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17714873#comment-17714873
]
ASF subversion and git services commented on KYLIN-5519:
--------------------------------------------------------
Commit e5a526ee1ede46f50059ac2e730d818efa283b94 in kylin's branch
refs/heads/kylin5 from Shao Feng Shi
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=e5a526ee1e ]
KYLIN-5519 DateFormatTest shouldn't rely on user's timezone
> DateFormatTest shouldn't rely on user's timezone
> ------------------------------------------------
>
> Key: KYLIN-5519
> URL: https://issues.apache.org/jira/browse/KYLIN-5519
> Project: Kylin
> Issue Type: Improvement
> Components: Tools, Build and Test
> Affects Versions: 5.0-alpha
> Reporter: Shao Feng Shi
> Assignee: Shao Feng Shi
> Priority: Major
> Fix For: 5.0-alpha
>
>
> When I run "mvn clean test", I got the following error:
>
> {code:java}
> [INFO] Results:
> [INFO]
> [ERROR] Failures:
> [ERROR] DateFormatTest.testStringToMillis:200 expected:<1669824000000> but
> was:<1669852800000>
> [ERROR] DateFormatTest.testStringToMillisSupplement:220
> expected:<1669824000000> but was:<1669852800000> {code}
> When look into the "DateFormatTest.testStringToMillis", it has no timezone
> specified when converting a Date time to epoch time. In the
> DateFormat.getDateFormat(), it uses the default timezone:
> {code:java}
> public static FastDateFormat getDateFormat(String datePattern) {
> FastDateFormat r = formatMap.get(datePattern);
> if (r == null) {
> r = FastDateFormat.getInstance(datePattern, TimeZone.getDefault());
> formatMap.put(datePattern, r);
> }
> return r;
> } {code}
>
> The function and test case shouldn't rely on user's default timezone. Which
> caused it may fail on another timezone.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)