Time-related integration tests failing #467
Labels
status: ideal-for-contribution
An issue that a contributor can help us with
type: task
A general task
Milestone
Bug Report
Time-related integration tests failing in both CodecBinaryFormatIntegrationTests and CodecTextFormatIntegrationTests.
Versions
Current Behavior
When running time-related unit tests, they fail:
Stack trace example:
Table schema
n/a
Steps to reproduce
Just run the integration tests on above OS/JDK
Expected behavior/code
The integration tests should pass
Possible Solution
Postgresql stores time with microsecond resolution, whereas the OS/JDK used retrieves the time in the java 8 java.time package with nanosecond resolution with 100 nanosecond precision. This causes the time-related integration to fail unless the nanosecond part is zero (which happens 1 in 10 times).
Since postgresql "only" stores microseconds, we could change the tests to assert with the
isEqualToIgnoringNanos(..)
instead ofisEqualTo(..)
function.A second option is, instead of relying on
LocalDateTime.now()
(and similar functions in other time-classes), to test with manually constructed times - such asLocalDateTime.of(...)
without setting nanos. I think the first option is better.Additional context
n/a
The text was updated successfully, but these errors were encountered: