diff --git a/temporal-sdk/src/test/java/io/temporal/workflow/nexus/OperationFailureConversionTest.java b/temporal-sdk/src/test/java/io/temporal/workflow/nexus/OperationFailureConversionTest.java index f0fca36d7..9a1717a49 100644 --- a/temporal-sdk/src/test/java/io/temporal/workflow/nexus/OperationFailureConversionTest.java +++ b/temporal-sdk/src/test/java/io/temporal/workflow/nexus/OperationFailureConversionTest.java @@ -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 { @@ -119,10 +118,10 @@ public OperationHandler 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")) {