Skip to content

Commit

Permalink
Make control message smaller, so to not break ARM tests
Browse files Browse the repository at this point in the history
While testing on ARM, our control message (64 symbols) is not shown in
logs. I presume, that on ARM this message weight more, than 128 bytes;
and so it is filtered by Quarkus. We should be careful around
encodings and byte limits in the future.

(cherry picked from commit fed2b5d)
  • Loading branch information
fedinskiy committed Sep 25, 2024
1 parent 278d022 commit 1608401
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,19 @@ public void logBigMessage() {
@Test
@Tag("https://issues.redhat.com/browse/QUARKUS-4531")
public void filterBigMessage() {
String shorterMessage = "You won't believe it, but this message is exactly 64 chars long!";
String longerMessage = shorterMessage.repeat(2);
Assertions.assertEquals(64, shorterMessage.getBytes(StandardCharsets.UTF_8).length);
String longerMessage = "You won't believe it, but this message is exactly 64 chars long!".repeat(2);
String control = "control";
Assertions.assertEquals(LENGTH_LIMIT, longerMessage.getBytes(StandardCharsets.UTF_8).length);

// the order below is important. We must make sure, that the shorter message is sent after the longer
app.given().when()
.post("/log/static/info?message={message}",
longerMessage)
.post("/log/static/info?message={message}", longerMessage)
.then().statusCode(204);
app.given().when()
.post("/log/static/info?message={message}",
shorterMessage)
.post("/log/static/info?message={message}", control)
.then().statusCode(204);

syslog.logs().assertContains(shorterMessage);
syslog.logs().assertContains(control);
syslog.getLogs()
.forEach(line -> {
Assertions.assertFalse(line.contains(longerMessage));
Expand Down

0 comments on commit 1608401

Please sign in to comment.