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 6ee1e5b211 test: deflake ConsulConfigurationTest#testInitSeataConfig
(#7584)
6ee1e5b211 is described below
commit 6ee1e5b211e96fe20f9f1c3141aa4f6b1cf1e14e
Author: Parkjihun <[email protected]>
AuthorDate: Thu Aug 14 16:27:56 2025 +0900
test: deflake ConsulConfigurationTest#testInitSeataConfig (#7584)
---
changes/en-us/2.x.md | 2 +-
changes/zh-cn/2.x.md | 1 +
.../apache/seata/config/consul/ConsulConfigurationTest.java | 12 +++++++++++-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index 702f5b4425..4cfd3314b4 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -53,7 +53,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7541](https://github.com/seata/seata/pull/7541)] fix jakarta UT failed in
jdk17+
- [[#7540](https://github.com/seata/seata/pull/7540)] fix port of mock server
- [[#7580](https://github.com/seata/seata/pull/7580)] fix the exception
caused by the disorder of test case execution order
-
+- [[#7584](https://github.com/apache/incubator-seata/pull/7584)] deflake
ConsulConfigurationTest#testInitSeataConfig with short await/retry to absorb CI
timing delay
### refactor:
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index d6a6930b2a..c6e1db12f6 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -51,6 +51,7 @@
- [[#7540](https://github.com/seata/seata/pull/7540)] 修复mock server端口冲突问题
- [[#7578](https://github.com/seata/seata/pull/7578)]
zstd解压由jni改为ZstdInputStream
- [[#7580](https://github.com/seata/seata/pull/7580)] 修复测试用例顺序错乱导致的异常
+- [[#7584](https://github.com/seata/seata/pull/7584)] 修复
ConsulConfigurationTest#testInitSeataConfig 在 CI 中由于等待/重试时间过短导致的不稳定问题
### refactor:
diff --git
a/config/seata-config-consul/src/test/java/org/apache/seata/config/consul/ConsulConfigurationTest.java
b/config/seata-config-consul/src/test/java/org/apache/seata/config/consul/ConsulConfigurationTest.java
index 2589ff7c6a..652a437f59 100644
---
a/config/seata-config-consul/src/test/java/org/apache/seata/config/consul/ConsulConfigurationTest.java
+++
b/config/seata-config-consul/src/test/java/org/apache/seata/config/consul/ConsulConfigurationTest.java
@@ -118,7 +118,17 @@ class ConsulConfigurationTest {
ConsulConfiguration newInstance = ConsulConfiguration.getInstance();
- assertEquals("val1", newInstance.getLatestConfig("key1", null, 1000));
+ // Short retry loop to absorb potential propagation delay in CI
environments
+ String value = null;
+ long deadline = System.nanoTime() +
java.util.concurrent.TimeUnit.SECONDS.toNanos(3); // Max ~3 seconds
+ do {
+ value = newInstance.getLatestConfig("key1", null, 1000);
+ if ("val1".equals(value)) break;
+ Thread.sleep(100);
+ } while (System.nanoTime() < deadline);
+
+ // Verify that the value retrieved matches the expected one
+ assertEquals("val1", value, "KV should be visible after a short
await");
}
// Utility method to set private fields via reflection
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]