Skip to content

Commit

Permalink
grpc-core: Fixed Review points
Browse files Browse the repository at this point in the history
  • Loading branch information
vinodhabib committed Oct 10, 2024
1 parent a64afcc commit 34d7c1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/test/java/io/grpc/internal/TimeProviderTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 The gRPC Authors
* Copyright 2024 The gRPC Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,8 +36,8 @@ public void testCurrentTimeNanos() {
long expectedTimeNanos = instantNow.getEpochSecond() * 1_000_000_000L + instantNow.getNano();

// Validate the time returned is close to the expected value within a tolerance.
long toleranceOfTwoMilliSecond = 2_000_000L; // 2 millisecond tolerance in nanoseconds
long toleranceOfTenMilliSecond = 10_000_000L; // 10 millisecond tolerance in nanoseconds
assertTrue("The current time in nanoseconds should be close to the expected time.",
Math.abs(actualTimeNanos - expectedTimeNanos) < toleranceOfTwoMilliSecond);
Math.abs(actualTimeNanos - expectedTimeNanos) < toleranceOfTenMilliSecond);
}
}

0 comments on commit 34d7c1d

Please sign in to comment.