Skip to content

Commit

Permalink
Ensure done before checking success to help troubleshoot timeout issu…
Browse files Browse the repository at this point in the history
…es (#4833)

* ensure done before checking success to help troubleshoot timeout issues

* add done check to testDefaultRetryPolicy method as well.

* ensure isDone() before other assertions
  • Loading branch information
breedx-splk committed Oct 13, 2022
1 parent d83d2d8 commit 3f4698a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Expand Up @@ -120,6 +120,10 @@ private static <T> void testRetryableStatusCodes(

CompletableResultCode resultCode =
exporter.apply(dataSupplier.get()).join(10, TimeUnit.SECONDS);
assertThat(resultCode.isDone())
.as("Exporter didn't complete in time. Consider increasing join timeout?")
.isTrue();

boolean retryable =
RetryUtil.retryableGrpcStatusCodes().contains(String.valueOf(code.value()));
boolean expectedResult = retryable || code == Status.Code.OK;
Expand Down Expand Up @@ -152,6 +156,9 @@ private static <T> void testDefaultRetryPolicy(
// Result should be failure, sever should have received maxAttempts requests
CompletableResultCode resultCode =
exporter.apply(dataSupplier.get()).join(10, TimeUnit.SECONDS);
assertThat(resultCode.isDone())
.as("Exporter didn't complete in time. Consider increasing join timeout?")
.isTrue();
assertThat(resultCode.isSuccess()).isFalse();
assertThat(serverRequestCountSupplier.get()).isEqualTo(maxAttempts);
}
Expand Down
Expand Up @@ -129,6 +129,10 @@ private static <T> void testRetryableStatusCodes(

CompletableResultCode resultCode =
exporter.apply(dataSupplier.get()).join(10, TimeUnit.SECONDS);
assertThat(resultCode.isDone())
.as("Exporter didn't complete in time. Consider increasing join timeout?")
.isTrue();

boolean retryable = code != 200 && RetryUtil.retryableHttpResponseCodes().contains(code);
boolean expectedResult = retryable || code == 200;
assertThat(resultCode.isSuccess())
Expand Down Expand Up @@ -159,6 +163,9 @@ private static <T> void testDefaultRetryPolicy(
// Result should be failure, sever should have received maxAttempts requests
CompletableResultCode resultCode =
exporter.apply(dataSupplier.get()).join(10, TimeUnit.SECONDS);
assertThat(resultCode.isDone())
.as("Exporter didn't complete in time. Consider increasing join timeout?")
.isTrue();
assertThat(resultCode.isSuccess()).isFalse();
assertThat(serverRequestCountSupplier.get()).isEqualTo(maxAttempts);
}
Expand Down

0 comments on commit 3f4698a

Please sign in to comment.