Skip to content

Commit 45c0a95

Browse files
authored
test: optimize 1.2.12 test-druid CI (#7530)
1 parent 90f3cf4 commit 45c0a95

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.github/workflows/test-druid.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ jobs:
8787
# step 4
8888
- name: "Test with Maven and Druid ${{ matrix.druid }}"
8989
run: |
90+
if [ "${{ matrix.druid }}" = "1.2.12" ]; then
91+
export skip.druid.tests=false;
92+
fi
9093
./mvnw -T 4C clean test \
9194
-Ddruid.version=${{ matrix.druid }} \
9295
-e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;

changes/en-us/2.x.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Add changes here for all PR submitted to the 2.x branch.
7373
- [[#7483](https://github.com/apache/incubator-seata/pull/7483)] change the value of retryDeadThreshold to 70 seconds
7474
- [[#7488](https://github.com/apache/incubator-seata/pull/7488)] upgrade tomcat to 9.0.106
7575
- [[#7518](https://github.com/apache/incubator-seata/pull/7518)] avoid using unstable API in ChannelEventHandlerIntegrationTest
76+
- [[#7526](https://github.com/apache/incubator-seata/pull/7518)] optimze: optimize 1.2.12 test-druid ci
7677

7778
### security:
7879

@@ -148,7 +149,7 @@ Thanks to these contributors for their code commits. Please report an unintended
148149
- [diguage](https://github.com/diguage)
149150
- [GoodBoyCoder](https://github.com/GoodBoyCoder)
150151
- [xxsc0529](https://github.com/xxsc0529)
151-
152+
- [xjlgod](https://github.com/xjlgod)
152153

153154

154155
Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.

changes/zh-cn/2.x.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
- [[#7478](https://github.com/apache/incubator-seata/pull/7478)] 增加处于重试状态的数据采集
7272
- [[#7483](https://github.com/apache/incubator-seata/pull/7483)] 将retryDeadThreshold改为70秒
7373
- [[#7518](https://github.com/apache/incubator-seata/pull/7518)] 避免在 ChannelEventHandlerIntegrationTest 中使用不稳定的 API
74-
74+
- [[#7526](https://github.com/apache/incubator-seata/pull/7518)] 优化druid 1.2.12 ci
7575

7676
### security:
7777

@@ -149,6 +149,6 @@
149149
- [diguage](https://github.com/diguage)
150150
- [GoodBoyCoder](https://github.com/GoodBoyCoder)
151151
- [xxsc0529](https://github.com/xxsc0529)
152-
152+
- [xjlgod](https://github.com/xjlgod)
153153

154154
同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。

server/src/test/java/org/apache/seata/server/session/db/DataBaseSessionManagerTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.junit.jupiter.api.Assertions;
3737
import org.junit.jupiter.api.BeforeAll;
3838
import org.junit.jupiter.api.Test;
39+
import org.junit.jupiter.api.condition.EnabledIf;
3940
import org.springframework.boot.test.context.SpringBootTest;
4041
import org.springframework.context.ApplicationContext;
4142
import org.springframework.context.annotation.Import;
@@ -55,6 +56,9 @@
5556
*/
5657
@SpringBootTest
5758
@Import(DynamicPortTestConfig.class)
59+
@EnabledIf(
60+
value = "org.apache.seata.server.session.db.DataBaseSessionManagerTest#isEnableDruidTest",
61+
disabledReason = "druid test is skipped")
5862
public class DataBaseSessionManagerTest {
5963

6064
static SessionManager sessionManager = null;
@@ -63,8 +67,15 @@ public class DataBaseSessionManagerTest {
6367

6468
static BasicDataSource dataSource = null;
6569

70+
public static boolean isEnableDruidTest() {
71+
// Unit test triggered a bug in Druid, see the issue https://github.com/alibaba/druid/issues/4936
72+
String skipTests = System.getProperty("skip.druid.tests", "true");
73+
return Boolean.parseBoolean(skipTests);
74+
}
75+
6676
@BeforeAll
6777
public static void start(ApplicationContext context) throws Exception {
78+
// Unit test triggered a bug in Druid, see the issue https://github.com/alibaba/druid/issues/4936
6879
DataBaseSessionManager tempSessionManager = new DataBaseSessionManager();
6980
DataBaseTransactionStoreManager transactionStoreManager = DataBaseTransactionStoreManager.getInstance();
7081

0 commit comments

Comments
 (0)