DataCleaner
DataCleaner copied to clipboard
TimeZone or time-of-day dependent test: ConvertToDateTransformerTest.testConvertFromExpression
In the recent build of #710, which ran just after midnight, I see that this test failed:
ConvertToDateTransformerTest.testConvertFromExpression:109 expected:<2015-09-[30]> but was:<2015-09-[29]>
Although the test has some awareness of timezones, it seems that the NOW()
, TODAY()
and YESTERDAY()
expressions used does not pass on any timezone. So there is a mismatch and around midnight there can be a discrepancy.
I think the major issue here is that the test is time dependent at all. We should probably find a way to make the transformer tests more repeatable.
A good way could be to use Java8 time internally and use a clock Clock instance to get all system clock-based times, then use Clock.fixed()
to get the same time every... Errr, time.