This is an automated email from the ASF dual-hosted git repository. jianbin pushed a commit to branch 2.x in repository https://gitbox.apache.org/repos/asf/incubator-seata.git
The following commit(s) were added to refs/heads/2.x by this push: new 2943e0946c test: fix TestConfigCustomSPI compatibility test fail (#6545) 2943e0946c is described below commit 2943e0946cd90e1c297e93b7984425ac7d1c680c Author: jimin <sliev...@163.com> AuthorDate: Tue May 14 13:37:16 2024 +0800 test: fix TestConfigCustomSPI compatibility test fail (#6545) --- changes/en-us/2.x.md | 1 + changes/zh-cn/2.x.md | 1 + .../io/seata/config/nacos/TestConfigCustomSPI.java | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index 0d15601000..204a64c9bc 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -156,6 +156,7 @@ Add changes here for all PR submitted to the 2.x branch. - [[#6456](https://github.com/apache/incubator-seata/pull/6456)] adjust the test cases related to dynamic configuration - [[#6466](https://github.com/apache/incubator-seata/pull/6466)] support redis integration testing - [[#6484](https://github.com/apache/incubator-seata/pull/6484)] fix FileConfigurationTest and MockServerTest fail +- [[#6545](https://github.com/apache/incubator-seata/pull/6545)] fix TestConfigCustomSPI compatibility test fail ### refactor: - [[#6280](https://github.com/apache/incubator-seata/pull/6280)] refactor Saga designer using diagram-js diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index 4182ac7177..722b4e89ea 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -153,6 +153,7 @@ - [[#6456](https://github.com/apache/incubator-seata/pull/6456)] 调整动态配置监听测试用例 - [[#6466](https://github.com/apache/incubator-seata/pull/6466)] 支持redis的集成测试 - [[#6484](https://github.com/apache/incubator-seata/pull/6484)] 修复FileConfigurationTest和MockServerTest失败 +- [[#6545](https://github.com/apache/incubator-seata/pull/6545)] 修复 TestConfigCustomSPI 兼容性测试失败 ### refactor: - [[#6280](https://github.com/apache/incubator-seata/pull/6280)] 使用diagram-js重构Saga设计器 diff --git a/config/seata-config-nacos/src/test/java/io/seata/config/nacos/TestConfigCustomSPI.java b/config/seata-config-nacos/src/test/java/io/seata/config/nacos/TestConfigCustomSPI.java index d65b67748d..93315924ad 100644 --- a/config/seata-config-nacos/src/test/java/io/seata/config/nacos/TestConfigCustomSPI.java +++ b/config/seata-config-nacos/src/test/java/io/seata/config/nacos/TestConfigCustomSPI.java @@ -16,6 +16,7 @@ */ package io.seata.config.nacos; +import java.security.SecureRandom; import java.util.Properties; import java.util.Set; import java.util.concurrent.CountDownLatch; @@ -42,6 +43,12 @@ public class TestConfigCustomSPI { private static final Config FILE_CONFIG = ConfigFactory.load("registry-test.conf"); private static ConfigService configService; + private static final String CHARACTERS = "abcdefghijklmnopqrstuvwxyz"; + + private static final int STRING_LENGTH = 6; + + private static final SecureRandom random = new SecureRandom(); + @BeforeAll public static void setup() throws NacosException { String serverAddr = FILE_CONFIG.getString("config.test.serverAddr"); @@ -55,7 +62,8 @@ public class TestConfigCustomSPI { public void testGetConfigProperties() throws Exception { Assertions.assertNotNull(configService); Configuration configuration = ConfigurationFactory.getInstance(); - String dataId = "nacos.config.custom.spi.test"; + String postfix = generateRandomString(); + String dataId = "nacos.config.custom.spi." + postfix; String group = FILE_CONFIG.getString("config.test.group"); String content = "seata"; CountDownLatch listenerCountDown = new CountDownLatch(1); @@ -78,6 +86,14 @@ public class TestConfigCustomSPI { } + public static String generateRandomString() { + StringBuilder sb = new StringBuilder(STRING_LENGTH); + for (int i = 0; i < STRING_LENGTH; i++) { + sb.append(CHARACTERS.charAt(random.nextInt(CHARACTERS.length()))); + } + return sb.toString(); + } + @AfterAll public static void afterAll() { } --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org