From fe53346697b9ff3755d53c9110c7c491b36f4373 Mon Sep 17 00:00:00 2001 From: yifeizhuang Date: Fri, 28 Apr 2023 11:17:49 -0700 Subject: [PATCH] xds: fix flaky xds test (#10109) --- xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java b/xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java index a5d7f09794..3ffcb5891e 100644 --- a/xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java +++ b/xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java @@ -3567,11 +3567,10 @@ public abstract class XdsClientImplTestBase { // Setup xdsClient to fail on stream creation XdsClientImpl client = createXdsClient("some.garbage"); client.watchXdsResource(XdsListenerResource.getInstance(), LDS_RESOURCE, ldsResourceWatcher); - fakeClock.forwardTime(20, TimeUnit.SECONDS); - verify(ldsResourceWatcher, Mockito.timeout(5000).times(1)).onError(ArgumentMatchers.any()); - fakeClock.forwardTime(50, TimeUnit.SECONDS); // Trigger rpcRetry if appropriate - assertThat(fakeClock.getPendingTasks(LDS_RESOURCE_FETCH_TIMEOUT_TASK_FILTER)).isEmpty(); + assertThat(fakeClock.numPendingTasks()).isEqualTo(1); //retry + assertThat(fakeClock.getPendingTasks().iterator().next().toString().contains("RpcRetryTask")) + .isTrue(); client.shutdown(); }