Home
last modified time | relevance | path

Searched refs:fakeClock (Results 1 – 15 of 15) sorted by relevance

/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/
DFakeClockTest.java39 FakeClock fakeClock = new FakeClock(); in testScheduledExecutorService_sameInstance() local
40 ScheduledExecutorService scheduledExecutorService1 = fakeClock.getScheduledExecutorService(); in testScheduledExecutorService_sameInstance()
41 ScheduledExecutorService scheduledExecutorService2 = fakeClock.getScheduledExecutorService(); in testScheduledExecutorService_sameInstance()
47 FakeClock fakeClock = new FakeClock(); in testScheduledExecutorService_isDone() local
48 ScheduledFuture<?> future = fakeClock.getScheduledExecutorService() in testScheduledExecutorService_isDone()
51 fakeClock.forwardNanos(99L); in testScheduledExecutorService_isDone()
54 fakeClock.forwardNanos(2L); in testScheduledExecutorService_isDone()
60 FakeClock fakeClock = new FakeClock(); in testScheduledExecutorService_cancel() local
61 ScheduledFuture<?> future = fakeClock.getScheduledExecutorService() in testScheduledExecutorService_cancel()
64 fakeClock.forwardNanos(99L); in testScheduledExecutorService_cancel()
[all …]
DRetriableStreamTest.java126 private final FakeClock fakeClock = new FakeClock(); field in RetriableStreamTest
182 MoreExecutors.directExecutor(), fakeClock.getScheduledExecutorService(), RETRY_POLICY, in newThrottledRetriableStream()
188 assertEquals(0, fakeClock.numPendingTasks()); in tearDown()
252 assertEquals(1, fakeClock.numPendingTasks()); in retry_everythingDrained()
258 fakeClock.forwardTime((long) (INITIAL_BACKOFF_IN_SECONDS * FAKE_RANDOM) - 1L, TimeUnit.SECONDS); in retry_everythingDrained()
260 assertEquals(1, fakeClock.numPendingTasks()); in retry_everythingDrained()
261 fakeClock.forwardTime(1L, TimeUnit.SECONDS); in retry_everythingDrained()
262 assertEquals(0, fakeClock.numPendingTasks()); in retry_everythingDrained()
296 assertEquals(1, fakeClock.numPendingTasks()); in retry_everythingDrained()
303 fakeClock.forwardTime( in retry_everythingDrained()
[all …]
DInternalSubchannelTest.java84 private final FakeClock fakeClock = new FakeClock(); field in InternalSubchannelTest
140 assertEquals(0, fakeClock.numPendingTasks()); in noMorePendingTasks()
197 fakeClock.forwardNanos(9); in singleAddressReconnect()
204 fakeClock.forwardNanos(1); in singleAddressReconnect()
222 fakeClock.forwardNanos(99); in singleAddressReconnect()
228 fakeClock.forwardNanos(1); in singleAddressReconnect()
311 fakeClock.forwardNanos(9); in twoAddressesReconnect()
316 fakeClock.forwardNanos(1); in twoAddressesReconnect()
343 fakeClock.forwardNanos(99); in twoAddressesReconnect()
348 fakeClock.forwardNanos(1); in twoAddressesReconnect()
[all …]
DDnsNameResolverTest.java92 private final FakeClock fakeClock = new FakeClock(); field in DnsNameResolverTest
154 assertEquals(0, fakeClock.numPendingTasks()); in noMorePendingTasks()
216 assertEquals(0, fakeClock.numPendingTasks()); in resolve_neverCache()
222 assertEquals(0, fakeClock.numPendingTasks()); in resolve_neverCache()
248 assertEquals(0, fakeClock.numPendingTasks()); in resolve_cacheForever()
255 assertEquals(0, fakeClock.numPendingTasks()); in resolve_cacheForever()
282 assertEquals(0, fakeClock.numPendingTasks()); in resolve_usingCache()
290 assertEquals(0, fakeClock.numPendingTasks()); in resolve_usingCache()
316 assertEquals(0, fakeClock.numPendingTasks()); in resolve_cacheExpired()
323 assertEquals(0, fakeClock.numPendingTasks()); in resolve_cacheExpired()
[all …]
DCensusModulesTest.java146 private final FakeClock fakeClock = new FakeClock(); field in CensusModulesTest
195 tagger, tagCtxSerializer, statsRecorder, fakeClock.getStopwatchSupplier(), true); in setUp()
375 fakeClock.forwardTime(30, MILLISECONDS); in subtestClientBasicStatsDefaultContext()
378 fakeClock.forwardTime(100, MILLISECONDS); in subtestClientBasicStatsDefaultContext()
383 fakeClock.forwardTime(16, MILLISECONDS); in subtestClientBasicStatsDefaultContext()
391 fakeClock.forwardTime(24, MILLISECONDS); in subtestClientBasicStatsDefaultContext()
488 fakeClock.forwardTime(3000, MILLISECONDS); in clientStreamNeverCreatedStillRecordStats()
573 fakeClock.getStopwatchSupplier(), in subtestStatsHeadersPropagateTags()
839 fakeClock.forwardTime(100, MILLISECONDS); in subtestServerBasicStatsNoHeaders()
844 fakeClock.forwardTime(16, MILLISECONDS); in subtestServerBasicStatsNoHeaders()
[all …]
DClientCallImplTest.java88 private final FakeClock fakeClock = new FakeClock(); field in ClientCallImplTest
90 fakeClock.getScheduledExecutorService();
657 fakeClock.forwardTime(System.nanoTime(), TimeUnit.NANOSECONDS); in deadlineExceededBeforeCallStarted()
785 fakeClock.forwardTime(System.nanoTime(), TimeUnit.NANOSECONDS); in expiredDeadlineCancelsStream_CallOptions()
799 fakeClock.forwardNanos(TimeUnit.SECONDS.toNanos(1) + 1); in expiredDeadlineCancelsStream_CallOptions()
807 fakeClock.forwardTime(System.nanoTime(), TimeUnit.NANOSECONDS); in expiredDeadlineCancelsStream_Context()
826 fakeClock.forwardNanos(TimeUnit.SECONDS.toNanos(1) + 1); in expiredDeadlineCancelsStream_Context()
834 fakeClock.forwardTime(System.nanoTime(), TimeUnit.NANOSECONDS); in streamCancelAbortsDeadlineTimer()
848 fakeClock.forwardNanos(TimeUnit.SECONDS.toNanos(1) + 1); in streamCancelAbortsDeadlineTimer()
/external/grpc-grpc-java/netty/src/test/java/io/grpc/netty/
DMaxConnectionIdleManagerTest.java38 private final FakeClock fakeClock = new FakeClock(); field in MaxConnectionIdleManagerTest
42 return fakeClock.getTicker().read();
59 maxConnectionIdleManager.start(ctx, fakeClock.getScheduledExecutorService()); in maxIdleReached()
61 fakeClock.forwardNanos(123L); in maxIdleReached()
71 maxConnectionIdleManager.start(ctx, fakeClock.getScheduledExecutorService()); in maxIdleNotReachedAndReached()
73 fakeClock.forwardNanos(100L); in maxIdleNotReachedAndReached()
77 fakeClock.forwardNanos(100L); in maxIdleNotReachedAndReached()
80 fakeClock.forwardNanos(100L); in maxIdleNotReachedAndReached()
86 fakeClock.forwardNanos(123L); in maxIdleNotReachedAndReached()
96 maxConnectionIdleManager.start(ctx, fakeClock.getScheduledExecutorService()); in shutdownThenMaxIdleReached()
[all …]
DNettyServerHandlerTest.java577 fakeClock().forwardNanos(keepAliveTimeInNanos); in keepAliveManager_pingSent()
583 fakeClock().forwardTime(10L, TimeUnit.MILLISECONDS); in keepAliveManager_pingSent()
596 fakeClock().forwardNanos(keepAliveTimeInNanos); in keepAliveManager_pingTimeout()
600 fakeClock().forwardNanos(keepAliveTimeoutInNanos); in keepAliveManager_pingTimeout()
690 fakeClock().forwardTime(20, TimeUnit.MINUTES); in noGoAwaySentBeforeMaxConnectionIdleReached()
705 fakeClock().forwardNanos(maxConnectionIdleInNanos); in maxConnectionIdle_goAwaySent_pingAck()
740 fakeClock().forwardNanos(maxConnectionIdleInNanos); in maxConnectionIdle_goAwaySent_pingTimeout()
754 fakeClock().forwardTime(10, TimeUnit.SECONDS); in maxConnectionIdle_goAwaySent_pingTimeout()
770 fakeClock().forwardNanos(maxConnectionIdleInNanos); in maxConnectionIdle_activeThenRst_pingAck()
780 fakeClock().forwardNanos(maxConnectionIdleInNanos); in maxConnectionIdle_activeThenRst_pingAck()
[all …]
DNettyTransportTest.java35 private final FakeClock fakeClock = new FakeClock(); field in NettyTransportTest
84 fakeClock.forwardNanos(unit.toNanos(offset)); in advanceClock()
89 return fakeClock.getTicker().read(); in fakeCurrentTimeNanos()
DNettyHandlerTestBase.java105 private final FakeClock fakeClock = new FakeClock(); field in NettyHandlerTestBase
107 FakeClock fakeClock() { in fakeClock() method in NettyHandlerTestBase
108 return fakeClock; in fakeClock()
184 future = fakeClock.getScheduledExecutorService().schedule(wrap, delay, timeUnit); in FakeClockScheduledNettyFuture()
/external/robolectric-shadows/utils/src/test/java/org/robolectric/util/
DPerfStatsCollectorTest.java18 private FakeClock fakeClock; field in PerfStatsCollectorTest
23 fakeClock = new FakeClock(); in setUp()
24 collector = new PerfStatsCollector(fakeClock); in setUp()
30 fakeClock.delay(20); in shouldMeasureElapsedTimeForEvents()
42 fakeClock.delay(20); in shouldMeasureElapsedTimeForRepeatedEvents()
46 fakeClock.delay(20); in shouldMeasureElapsedTimeForRepeatedEvents()
50 fakeClock.delay(20); in shouldMeasureElapsedTimeForRepeatedEvents()
62 fakeClock.delay(10); in shouldRunAndMeasureSuccessfulCallable()
73 fakeClock.delay(10); in shouldRunAndMeasureExceptionThrowingCallable()
79 fakeClock.delay(5); in shouldRunAndMeasureExceptionThrowingCallable()
[all …]
/external/grpc-grpc-java/grpclb/src/test/java/io/grpc/grpclb/
DGrpclbLoadBalancerTest.java148 private final FakeClock fakeClock = new FakeClock(); field in GrpclbLoadBalancerTest
159 return fakeClock.getTicker().read();
250 ScheduledExecutorService timerService = fakeClock.getScheduledExecutorService(); in setUp()
290 assertThat(fakeClock.getPendingTasks()).isEmpty(); in tearDown()
403 assertEquals(1, fakeClock.numPendingTasks(FALLBACK_MODE_TASK_FILTER)); in loadReporting()
419 assertEquals(0, fakeClock.numPendingTasks(LOAD_REPORTING_TASK_FILTER)); in loadReporting()
423 assertEquals(1, fakeClock.numPendingTasks(LOAD_REPORTING_TASK_FILTER)); in loadReporting()
424 assertEquals(0, fakeClock.runDueTasks()); in loadReporting()
557 assertEquals(1, fakeClock.numPendingTasks()); in loadReporting()
560 assertEquals(0, fakeClock.numPendingTasks()); in loadReporting()
[all …]
/external/grpc-grpc-java/okhttp/src/test/java/io/grpc/okhttp/
DOkHttpTransportTest.java37 private final FakeClock fakeClock = new FakeClock(); field in OkHttpTransportTest
89 fakeClock.forwardNanos(unit.toNanos(offset)); in advanceClock()
94 return fakeClock.getTicker().read(); in fakeCurrentTimeNanos()
/external/grpc-grpc-java/core/src/test/java/io/grpc/
DContextsTest.java216 FakeClock fakeClock = new FakeClock(); in statusFromCancelled_TimeoutExceptionShouldMapToDeadlineExceeded() local
218 .withDeadlineAfter(100, TimeUnit.NANOSECONDS, fakeClock.getScheduledExecutorService()); in statusFromCancelled_TimeoutExceptionShouldMapToDeadlineExceeded()
219 fakeClock.forwardTime(System.nanoTime(), TimeUnit.NANOSECONDS); in statusFromCancelled_TimeoutExceptionShouldMapToDeadlineExceeded()
220 fakeClock.forwardNanos(100); in statusFromCancelled_TimeoutExceptionShouldMapToDeadlineExceeded()
/external/grpc-grpc-java/testing/src/test/java/io/grpc/testing/
DGrpcCleanupRuleTest.java52 public static final FakeClock fakeClock = new FakeClock(); field in GrpcCleanupRuleTest
320 GrpcCleanupRule grpcCleanup = new GrpcCleanupRule().setTicker(fakeClock.getTicker()); in multiResource_timeoutCalculation()
358 .setTicker(fakeClock.getTicker()).setTimeout(3000, TimeUnit.NANOSECONDS); in multiResource_timeoutCalculation_customTimeout()
434 fakeClock.forwardTime(cleanupNanos, TimeUnit.NANOSECONDS); in cleanUp()
443 fakeClock.forwardTime(awaitReleaseNanos, TimeUnit.NANOSECONDS); in awaitReleased()