Update spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/wavefront/WavefrontTracingIntegrationTests.java

Co-authored-by: Jonatan Ivanov <jonatan.ivanov@gmail.com>
This commit is contained in:
Marcin Grzejszczak
2021-02-19 08:42:11 +01:00
committed by Marcin Grzejszczak
parent 08eca91625
commit 2e2a87e367

View File

@@ -91,7 +91,7 @@ public class WavefrontTracingIntegrationTests {
assertThat(spanRecord.name).isEqualTo("GET /api/fn/{id}");
// spot check the unit is valid (millis not micros)
long currentTime = System.currentTimeMillis();
long currentTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
assertThat(spanRecord.startMillis).isGreaterThan(currentTime - 5000).isLessThan(currentTime);
// Less than a millis should round up to 1, but the test could take longer than
// 1ms