aboutsummaryrefslogtreecommitdiff
path: root/okhttp
diff options
context:
space:
mode:
authorZHANG Dapeng <zdapeng@google.com>2018-05-21 12:44:06 -0700
committerGitHub <noreply@github.com>2018-05-21 12:44:06 -0700
commitf5f560ad365735a0c9bf8b86abeed16cf7dfdde7 (patch)
treeb0a34ef4d5036958b505cc1a4785ba883a91dfda /okhttp
parent30478d88c722a5a25e74f80e43578cb265d0ccfb (diff)
downloadgrpc-grpc-java-f5f560ad365735a0c9bf8b86abeed16cf7dfdde7.tar.gz
all: TimeProvider to use nanos rather than millis
This is the same practice as #2833
Diffstat (limited to 'okhttp')
-rw-r--r--okhttp/src/test/java/io/grpc/okhttp/OkHttpTransportTest.java12
1 files changed, 2 insertions, 10 deletions
diff --git a/okhttp/src/test/java/io/grpc/okhttp/OkHttpTransportTest.java b/okhttp/src/test/java/io/grpc/okhttp/OkHttpTransportTest.java
index 7a0178d53..5b5fe91e9 100644
--- a/okhttp/src/test/java/io/grpc/okhttp/OkHttpTransportTest.java
+++ b/okhttp/src/test/java/io/grpc/okhttp/OkHttpTransportTest.java
@@ -22,7 +22,6 @@ import io.grpc.internal.ClientTransportFactory;
import io.grpc.internal.FakeClock;
import io.grpc.internal.InternalServer;
import io.grpc.internal.ManagedClientTransport;
-import io.grpc.internal.TransportTracer;
import io.grpc.internal.testing.AbstractTransportTest;
import io.grpc.netty.NettyServerBuilder;
import java.net.InetSocketAddress;
@@ -38,13 +37,6 @@ import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class OkHttpTransportTest extends AbstractTransportTest {
private final FakeClock fakeClock = new FakeClock();
- private final TransportTracer.Factory fakeClockTransportTracer = new TransportTracer.Factory(
- new TransportTracer.TimeProvider() {
- @Override
- public long currentTimeMillis() {
- return fakeClock.currentTimeMillis();
- }
- });
private ClientTransportFactory clientFactory = OkHttpChannelBuilder
// Although specified here, address is ignored because we never call build.
.forAddress("localhost", 0)
@@ -100,8 +92,8 @@ public class OkHttpTransportTest extends AbstractTransportTest {
}
@Override
- protected long currentTimeMillis() {
- return fakeClock.currentTimeMillis();
+ protected long fakeCurrentTimeNanos() {
+ return fakeClock.getTicker().read();
}
// TODO(ejona): Flaky/Broken