You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2024/09/09 08:32:24 UTC
(rocketmq) branch develop updated: [ISSUE #8668] Improve CI pipeline reliability with better log viewing and test fixes (#8667)
This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new e7eda2c957 [ISSUE #8668] Improve CI pipeline reliability with better log viewing and test fixes (#8667)
e7eda2c957 is described below
commit e7eda2c95763a79921f39627e6a0fcbf3b8442c6
Author: 小陈 <ja...@gmail.com>
AuthorDate: Mon Sep 9 16:32:19 2024 +0800
[ISSUE #8668] Improve CI pipeline reliability with better log viewing and test fixes (#8667)
* Add sleep 3s after consumer shutdown to ensure queue rebanlance
* Add a step to upload test report
* Unified code style
* Unified mockito runner configuration to suppress UnnecessaryStubbingException
---
.github/workflows/integration-test.yml | 9 ++++++++-
.../rocketmq/client/consumer/DefaultLitePullConsumerTest.java | 5 +----
.../rocketmq/client/consumer/DefaultMQPushConsumerTest.java | 4 +++-
.../test/client/consumer/balance/NormalMsgDynamicBalanceIT.java | 2 ++
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml
index 33b0a01ad4..8179f36287 100644
--- a/.github/workflows/integration-test.yml
+++ b/.github/workflows/integration-test.yml
@@ -35,4 +35,11 @@ jobs:
- name: Run integration tests with Maven
run: mvn clean verify -Pit-test -Pskip-unit-tests
-
+ - name: Publish Test Report
+ uses: mikepenz/action-junit-report@v3
+ if: always()
+ with:
+ report_paths: 'test/target/failsafe-reports/TEST-*.xml'
+ annotate_only: true
+ include_passed: true
+ detailed_summary: true
diff --git a/client/src/test/java/org/apache/rocketmq/client/consumer/DefaultLitePullConsumerTest.java b/client/src/test/java/org/apache/rocketmq/client/consumer/DefaultLitePullConsumerTest.java
index 65237bc8f7..592c247057 100644
--- a/client/src/test/java/org/apache/rocketmq/client/consumer/DefaultLitePullConsumerTest.java
+++ b/client/src/test/java/org/apache/rocketmq/client/consumer/DefaultLitePullConsumerTest.java
@@ -63,8 +63,6 @@ import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.junit.MockitoJUnitRunner;
-import org.mockito.quality.Strictness;
-import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.stubbing.Answer;
import static org.assertj.core.api.Assertions.assertThat;
@@ -81,8 +79,7 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
-@RunWith(MockitoJUnitRunner.class)
-@MockitoSettings(strictness = Strictness.LENIENT)
+@RunWith(MockitoJUnitRunner.Silent.class)
public class DefaultLitePullConsumerTest {
@Spy
private MQClientInstance mQClientFactory = MQClientManager.getInstance().getOrCreateMQClientInstance(new ClientConfig());
diff --git a/client/src/test/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumerTest.java b/client/src/test/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumerTest.java
index a10fd74b34..834be5cf16 100644
--- a/client/src/test/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumerTest.java
+++ b/client/src/test/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumerTest.java
@@ -209,7 +209,9 @@ public class DefaultMQPushConsumerTest {
@AfterClass
public static void terminate() {
- pushConsumer.shutdown();
+ if (pushConsumer != null) {
+ pushConsumer.shutdown();
+ }
}
@Test
diff --git a/test/src/test/java/org/apache/rocketmq/test/client/consumer/balance/NormalMsgDynamicBalanceIT.java b/test/src/test/java/org/apache/rocketmq/test/client/consumer/balance/NormalMsgDynamicBalanceIT.java
index 684b718ae5..7408a092c4 100644
--- a/test/src/test/java/org/apache/rocketmq/test/client/consumer/balance/NormalMsgDynamicBalanceIT.java
+++ b/test/src/test/java/org/apache/rocketmq/test/client/consumer/balance/NormalMsgDynamicBalanceIT.java
@@ -96,6 +96,8 @@ public class NormalMsgDynamicBalanceIT extends BaseConf {
MQWait.waitConsumeAll(CONSUME_TIME, producer.getAllMsgBody(), consumer1.getListener(),
consumer2.getListener(), consumer3.getListener());
consumer3.shutdown();
+ TestUtils.waitForSeconds(WAIT_TIME);
+
producer.clearMsg();
consumer1.clearMsg();
consumer2.clearMsg();