exceptionfactory commented on pull request #4734:
URL: https://github.com/apache/nifi/pull/4734#issuecomment-754765641


   > @exceptionfactory , thanks for the PR.
   > 
   > I ran the unit tests in CET timezone, and one of the newly added tests 
fails:
   > 
   > ```
   > [ERROR] 
testFormattedStringToDateWithSystemDefaultZoneId(org.apache.nifi.serialization.record.TestDataTypeUtils)
  Time elapsed: 0.007 s  <<< FAILURE!
   > org.junit.ComparisonFailure: expected:<19[70-01-0]1> but was:<19[69-12-3]1>
   >    at 
org.apache.nifi.serialization.record.TestDataTypeUtils.testFormattedStringToDateWithSystemDefaultZoneId(TestDataTypeUtils.java:168)
   > ```
   > 
   > I'll do some debugging to see what goes wrong.
   
   @adenes Thanks for the feedback.  After looking more closely at 
`DateUtils.getDateFormat(format, timezoneID)` it makes sense that the test in 
question would behave differently based on the system default timezone.  I 
pushed an update to `TestDataTypeUtils` that changes the test to use 
`DateUtils.getDateFormat(format)`, which implicitly sets the `DateFormat` time 
zone to GMT.  This should avoid failures due to system differences and also 
test the implicit behavior.


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to