tests: support more-precise clocks in Java 11 (#10381)

This commit is contained in:
Ry Biesemeyer 2019-02-05 08:08:49 -08:00 committed by GitHub
parent 583ec6b625
commit 9e886a9682
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,9 @@ public class TimestampTest {
Instant i = Instant.now();
Timestamp t1 = new Timestamp(i.toEpochMilli());
long usec = t1.usec();
Assert.assertEquals(i.getNano() / 1000, usec);
// since our Timestamp was created with epoch millis, it cannot be more precise.
Assert.assertEquals(i.getNano() / 1_000_000, usec / 1_000);
}
@Test