From 1608401e6e4de2e37e1ced74b48b3eb999cac17b Mon Sep 17 00:00:00 2001 From: Fedor Dudinsky Date: Tue, 24 Sep 2024 16:49:33 +0200 Subject: [PATCH] Make control message smaller, so to not break ARM tests 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 fed2b5d69dceb4e525d3f38706e03e62aa556a6f) --- .../java/io/quarkus/ts/logging/jboss/SyslogIT.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/logging/thirdparty/src/test/java/io/quarkus/ts/logging/jboss/SyslogIT.java b/logging/thirdparty/src/test/java/io/quarkus/ts/logging/jboss/SyslogIT.java index be055c5fd..a5403e491 100644 --- a/logging/thirdparty/src/test/java/io/quarkus/ts/logging/jboss/SyslogIT.java +++ b/logging/thirdparty/src/test/java/io/quarkus/ts/logging/jboss/SyslogIT.java @@ -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));