Skip to content

Commit

Permalink
fix: message
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-geller committed Sep 22, 2024
1 parent f494a9b commit bc534d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jdbc/src/main/java/io/kestra/jdbc/runner/JdbcQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected Map<Field<Object>, Object> produceFields(String consumerGroup, String
if (messageProtectionConfiguration.enabled && bytes.length >= messageProtectionConfiguration.limit) {
// we let terminated execution messages to go through anyway
if (!(message instanceof Execution execution) || !execution.getState().isTerminated()) {
throw new MessageTooBigException("Message of size " + bytes.length + " exceed the configured limit of " + messageProtectionConfiguration.limit);
throw new MessageTooBigException("Message of size " + bytes.length + " has exceeded the configured limit of " + messageProtectionConfiguration.limit);
}
}

Expand Down
4 changes: 2 additions & 2 deletions jdbc/src/test/java/io/kestra/jdbc/runner/JdbcRunnerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void queueMessageTooLarge() {

// the size is different on all runs, so we cannot assert on the exact message size
assertThat(exception.getMessage(), containsString("Message of size"));
assertThat(exception.getMessage(), containsString("exceed the configured limit of 1048576"));
assertThat(exception.getMessage(), containsString("has exceeded the configured limit of 1048576"));
assertThat(exception, instanceOf(MessageTooBigException.class));
}

Expand All @@ -443,7 +443,7 @@ void workerTaskResultTooLarge() throws TimeoutException, QueueException {
assertThat(matchingLog.getLevel(), is(Level.ERROR));
// the size is different on all runs, so we cannot assert on the exact message size
assertThat(matchingLog.getMessage(), containsString("Message of size"));
assertThat(matchingLog.getMessage(), containsString("exceed the configured limit of 1048576"));
assertThat(matchingLog.getMessage(), containsString("has exceeded the configured limit of 1048576"));

assertThat(execution.getState().getCurrent(), is(State.Type.FAILED));
assertThat(execution.getTaskRunList().size(), is(1));
Expand Down

0 comments on commit bc534d4

Please sign in to comment.