Chinmay N Hegde created RANGER-5754:
---------------------------------------

             Summary: Fix timezone-sensitive test failures in MiscUtilTest
                 Key: RANGER-5754
                 URL: https://issues.apache.org/jira/browse/RANGER-5754
             Project: Ranger
          Issue Type: Bug
          Components: Ranger
    Affects Versions: 3.0.0
            Reporter: Chinmay N Hegde
            Assignee: Chinmay N Hegde


Timezone-dependent unit test failures found in MiscUtilTest (failure outside 
UTC)
mainly in *testGetFormattedTime* and *testGetUTCDateForLocalDate.*

For *testGetFormattedTime,* the test previously asserted a hardcoded UTC date, 
while MiscUtil.getFormattedTime() uses SimpleDateFormat with the JVM default 
timezone. 

For {*}getUTCDateForLocalDate{*}, the method used timezone offset at the 
current time (getOffset(local.getTimeInMillis())) instead of the input date 
(getOffset(date.getTime())). In DST-observing zones, this can apply the wrong 
seasonal offset.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to