From 4105df50fc9efafacfcbbfb8163a9c066d3c5df9 Mon Sep 17 00:00:00 2001 From: andsel Date: Fri, 15 Dec 2023 12:48:24 +0100 Subject: [PATCH] TestCI bugfix investigation --- .github/workflows/temp_maven_build_debug.yml | 26 +++++++++++++++++++ .../mqtt5/SharedSubscriptionTest.java | 3 +++ broker/src/test/resources/log4j.properties | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/temp_maven_build_debug.yml diff --git a/.github/workflows/temp_maven_build_debug.yml b/.github/workflows/temp_maven_build_debug.yml new file mode 100644 index 000000000..987e1587c --- /dev/null +++ b/.github/workflows/temp_maven_build_debug.yml @@ -0,0 +1,26 @@ +# This workflow is copied from maven_build.yml and is temporarily used to throubleshoot failure that appears only in CI + +name: Java CI with Maven + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + name: Temp test of CI + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: 17 + architecture: x64 + - name: Test with Maven + run: ./mvnw -Dtest="SharedSubscriptionTest#givenSharedSubscriptionWithCertainQoSWhenSameClientWithSameShareSubscribeToSameTopicFilterThenQoSUpdates" test -pl broker --file pom.xml + diff --git a/broker/src/test/java/io/moquette/integration/mqtt5/SharedSubscriptionTest.java b/broker/src/test/java/io/moquette/integration/mqtt5/SharedSubscriptionTest.java index 95898dac5..36cd72960 100644 --- a/broker/src/test/java/io/moquette/integration/mqtt5/SharedSubscriptionTest.java +++ b/broker/src/test/java/io/moquette/integration/mqtt5/SharedSubscriptionTest.java @@ -193,6 +193,7 @@ private static void verifyPubPayload(MqttMessage received, String expectedPayloa MqttPublishMessage pub = (MqttPublishMessage) received; String payload = pub.payload().asByteBuf().toString(StandardCharsets.UTF_8); assertEquals(expectedPayload, payload); + assertTrue(pub.release(), "received message must be deallocated"); } @NotNull @@ -279,6 +280,8 @@ public void givenSharedSubscriptionWithCertainQoSWhenSameClientWithSameShareSubs // because the PUB is at QoS1 and the subscription is at QoS0, the subscribed doesn't receive any message verifyNoPublish(subscriberClient,Duration.ofSeconds(1), "No message is expected at Qos0 subscription"); + LOG.info("Before repeating with AT_LEAST_ONCE"); + // update QoS for shared subscription subscribe(subscriberClient, "$share/collectors/metric/temperature/living", MqttQos.AT_LEAST_ONCE); diff --git a/broker/src/test/resources/log4j.properties b/broker/src/test/resources/log4j.properties index fe693b8bc..af413b8d2 100644 --- a/broker/src/test/resources/log4j.properties +++ b/broker/src/test/resources/log4j.properties @@ -1,7 +1,7 @@ #log4j.rootLogger=ERROR, stdout, file log4j.rootLogger=ERROR, stdout -log4j.logger.io.moquette=WARN +log4j.logger.io.moquette=DEBUG #log4j.logger.io.moquette.broker=DEBUG #log4j.logger.io.moquette.broker.MQTTConnection=DEBUG #log4j.logger.io.moquette.broker.SessionRegistry=DEBUG