Skip to content

Commit

Permalink
Fix test for real server
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns committed Oct 15, 2024
1 parent 05dd529 commit af501b2
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ public void nexusOperationApplicationFailureFailureConversion() {
NexusOperationFailure nexusFailure = (NexusOperationFailure) exception.getCause();
Assert.assertTrue(nexusFailure.getCause() instanceof ApplicationFailure);
ApplicationFailure applicationFailure = (ApplicationFailure) nexusFailure.getCause();
Assert.assertEquals(
"message='exceeded invocation count', type='TestFailure', nonRetryable=true",
applicationFailure.getOriginalMessage());
Assert.assertTrue(
applicationFailure.getOriginalMessage().contains("exceeded invocation count"));
}

public static class TestNexus implements TestWorkflow1 {
Expand Down Expand Up @@ -119,10 +118,10 @@ public OperationHandler<String, String> operation() {
details.getRequestId(),
invocationCount.getOrDefault(details.getRequestId(), 0) + 1);
if (name.equals("ApplicationFailure")) {
// Limit the number of retries to 5 to avoid overwhelming the test server
if (invocationCount.get(details.getRequestId()) > 5) {
// Limit the number of retries to 2 to avoid overwhelming the test server
if (invocationCount.get(details.getRequestId()) >= 2) {
throw ApplicationFailure.newNonRetryableFailure(
"exceeded invocation count", "TestFailure");
"exceeded invocation count", "ExceededInvocationCount");
}
throw ApplicationFailure.newFailure("failed to call operation", "TestFailure");
} else if (name.equals("ApplicationFailureNonRetryable")) {
Expand Down

0 comments on commit af501b2

Please sign in to comment.