DataCleaner icon indicating copy to clipboard operation
DataCleaner copied to clipboard

TimeZone or time-of-day dependent test: ConvertToDateTransformerTest.testConvertFromExpression

Open kaspersorensen opened this issue 9 years ago • 1 comments

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.

kaspersorensen avatar Sep 30 '15 06:09 kaspersorensen

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.

LosD avatar Sep 09 '16 07:09 LosD