Skip to content

Commit c05271e

Browse files
committed
Fix message-too-large tests
1 parent 55eea5e commit c05271e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

temporal-sdk/src/test/java/io/temporal/workflow/GrpcMessageTooLargeTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import org.junit.Test;
2323

2424
public class GrpcMessageTooLargeTest {
25-
private static final String QUERY_ERROR_MESSAGE =
26-
"Failed to send query response: RESOURCE_EXHAUSTED: grpc: received message larger than max";
25+
// This string is kept intentionally short to match multiple possible too-large error messages
26+
private static final String TOO_BIG_ERR_MESSAGE = "larger than max";
2727
private static final String VERY_LARGE_DATA;
2828

2929
static {
@@ -120,7 +120,7 @@ public void queryResultTooLarge() {
120120
assertNotNull(e.getCause());
121121
// The exception will not contain the original failure object, so instead of type check we're
122122
// checking the message to ensure the correct error is being sent.
123-
assertTrue(e.getCause().getMessage().contains(QUERY_ERROR_MESSAGE));
123+
assertTrue(e.getCause().getMessage().contains(TOO_BIG_ERR_MESSAGE));
124124
}
125125

126126
@Test
@@ -132,7 +132,7 @@ public void queryErrorTooLarge() {
132132
WorkflowQueryException e = assertThrows(WorkflowQueryException.class, workflow::query);
133133

134134
assertNotNull(e.getCause());
135-
assertTrue(e.getCause().getMessage().contains(QUERY_ERROR_MESSAGE));
135+
assertTrue(e.getCause().getMessage().contains(TOO_BIG_ERR_MESSAGE));
136136
}
137137

138138
private static <T> T createWorkflowStub(Class<T> clazz, SDKTestWorkflowRule workflowRule) {

0 commit comments

Comments
 (0)