From a0e50751973fa316b96b550394464681e3b92442 Mon Sep 17 00:00:00 2001 From: hannahrogers-google <52459909+hannahrogers-google@users.noreply.github.com> Date: Mon, 18 May 2020 15:04:19 -0400 Subject: [PATCH] fix: add wait in retry test Adding a wait in the retry test to ensure that the scheduled retry completes. --- .../cloud/pubsublite/internal/wire/PublisherImplTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/google-cloud-pubsublite/src/test/java/com/google/cloud/pubsublite/internal/wire/PublisherImplTest.java b/google-cloud-pubsublite/src/test/java/com/google/cloud/pubsublite/internal/wire/PublisherImplTest.java index 1af6592aa..fe14542dd 100755 --- a/google-cloud-pubsublite/src/test/java/com/google/cloud/pubsublite/internal/wire/PublisherImplTest.java +++ b/google-cloud-pubsublite/src/test/java/com/google/cloud/pubsublite/internal/wire/PublisherImplTest.java @@ -247,6 +247,10 @@ public void retryableError_RecreatesAndRetriesAll() throws Exception { .when(mockPublisherFactory) .New(any(), any(), eq(INITIAL_PUBLISH_REQUEST)); leakedOffsetStream.onError(Status.UNKNOWN.asRuntimeException()); + + // wait for retry to complete + Thread.sleep(500); + verify(mockBatchPublisher).close(); verifyNoMoreInteractions(mockBatchPublisher); verify(mockPublisherFactory, times(2)).New(any(), any(), eq(INITIAL_PUBLISH_REQUEST));