From 307c95eaba8447f4e07db66137b88a528fd15934 Mon Sep 17 00:00:00 2001 From: Artur Souza Date: Sun, 28 Jul 2024 09:32:28 -0300 Subject: [PATCH] Update error message expectations in 1.15 Signed-off-by: Artur Souza --- .../java/io/dapr/it/methodinvoke/grpc/MethodInvokeIT.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sdk-tests/src/test/java/io/dapr/it/methodinvoke/grpc/MethodInvokeIT.java b/sdk-tests/src/test/java/io/dapr/it/methodinvoke/grpc/MethodInvokeIT.java index 5eac1b2a7..a4d9dd835 100644 --- a/sdk-tests/src/test/java/io/dapr/it/methodinvoke/grpc/MethodInvokeIT.java +++ b/sdk-tests/src/test/java/io/dapr/it/methodinvoke/grpc/MethodInvokeIT.java @@ -30,7 +30,6 @@ public class MethodInvokeIT extends BaseIT { private static final int TIMEOUT_MS = 100; private static final ResiliencyOptions RESILIENCY_OPTIONS = new ResiliencyOptions() .setTimeout(Duration.ofMillis(TIMEOUT_MS)); - private static final String EXCEPTION_MARKER = "DEADLINE_EXCEEDED: deadline exceeded after"; /** * Run of a Dapr application. @@ -92,7 +91,8 @@ public void testInvokeTimeout() throws Exception { String message = assertThrows(StatusRuntimeException.class, () -> stub.sleep(req)).getMessage(); long delay = System.currentTimeMillis() - started; assertTrue(delay >= TIMEOUT_MS, "Delay: " + delay + " is not greater than timeout: " + TIMEOUT_MS); - assertTrue(message.startsWith(EXCEPTION_MARKER), "Message: " + message + " does not start with: " + EXCEPTION_MARKER); + assertTrue(message.contains("DEADLINE_EXCEEDED")); + assertTrue(message.contains("CallOptions deadline exceeded after")); } } @@ -112,7 +112,8 @@ public void testInvokeException() throws Exception { // If this test fails, there might be a regression in runtime (like we had in 1.10.0). // The expectations below are as per 1.9 release and (later on) hotfixed in 1.10. assertEquals(Status.UNKNOWN.getCode(), exception.getStatus().getCode()); - assertEquals("", exception.getStatus().getDescription()); + // The error message below is added starting in Dapr 1.15.0 + assertEquals("Application error processing RPC", exception.getStatus().getDescription()); } }