You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explanation :
Since Java17, Instant.now.() has nano precision (at least on linux) where before it was just a millisecond precision.
Tests based on SenML JSON, failed because by default Jackson cast number in double and so lost some precision when nanoseconds are used. (and so equality test failed)
Solutions :
I see 2 possible ways to fix this :
a) change the JSON deserializer config to not lost precision using BigDecimal instead of double : using ObjectMapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true) to be able to handle nanoseconds.
b) change test to use milliseconds precision in tests.
I don't think a) is a good default behavior because :
I think nanoseconds usecase is not so common (I could be wrong on that one)
The nightly build execute tests with java 8, 11, 17, 21 :
And it failed with error like :
It seems there is some timestamps precision issue :
See : https://ci.eclipse.org/leshan/job/leshan-nightly/job/master/32/consoleFull
If seems that
Instant.now()
precision changed : https://stackoverflow.com/questions/74781495/changes-in-instant-now-between-java-11-and-java-17-in-aws-ubuntu-standard-6-0The text was updated successfully, but these errors were encountered: