mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
tests: support more-precise clocks in Java 11 (#10381)
This commit is contained in:
parent
583ec6b625
commit
9e886a9682
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue