We're updating the issue view to help you get more done. 

Java 11 causes Instant-based unit test to fail

Description

When building the maven project with Java 11, a test fails:

 

Environment

None

Acceptance Test - Entry

None

Activity

Show:
Daryl Herzmann
April 19, 2019, 4:09 PM

I gave this a shot, but was unsure what to do.  The SystemProperty class appears to round trip the Instant value with nano-seconds dropped, so when it comes back for comparison, the values are no longer exactly equal.

Greg Thomas
April 19, 2019, 4:46 PM

Every day is a school day.

It turns out that as of Java 9, Instant.now() has nanosecond resolution when it's available. As we're only saving the instant in the DB with millisecond resolution, there's now a (slight!) difference when it's retrieved again. 

The fix is easy enough; truncate the Instant before saving it. I'm not going to lose any sleep over losing the nano-second precision when saving properties.

Fixed

Assignee

Greg Thomas

Reporter

Guus der Kinderen

Labels

None

Expected Effort

None

Ignite Forum URL

None

Fix versions

Priority

Major
Configure