This is an automated email from the ASF dual-hosted git repository.

jimin 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 19e5013e33 test: fix non-deteriministic in 
JsonParserWrapTest#testToJSONString due to key order (#7801)
19e5013e33 is described below

commit 19e5013e33e0e8d316aca091ddf9fc54d9283e9d
Author: Xiaoyang Cai <[email protected]>
AuthorDate: Tue Nov 25 20:25:01 2025 -0600

    test: fix non-deteriministic in JsonParserWrapTest#testToJSONString due to 
key order (#7801)
---
 changes/en-us/2.x.md                                           |  1 +
 changes/zh-cn/2.x.md                                           |  1 +
 .../seata/integration/tx/api/json/JsonParserWrapTest.java      | 10 +++++++++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index c2bdc6ead3..014d611931 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -119,6 +119,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7727](https://github.com/apache/incubator-seata/pull/7727)] add some UT 
for compatible module
 - [[#7803](https://github.com/apache/incubator-seata/pull/7803)] Fix flakiness 
in `DataCompareUtilsTest` caused by non-deterministic Map key iteration order.
 - [[#7804](https://github.com/apache/incubator-seata/pull/7804)] fix 
testXARollbackWithResourceLock() to ensure ci runs normally
+- [[#7801](https://github.com/apache/incubator-seata/pull/7801)] Fix 
non-deteriministic in JsonParserWrapTest#testToJSONString due to key order
 - [[#7800](https://github.com/apache/incubator-seata/pull/7800)] fix 
non-deterministic in StringUtilsTest#testToStringAndCycleDependency
 - [[#7802](https://github.com/apache/incubator-seata/pull/7802)] Fix 
non-deterministic in `ConnectionContextProxyTest`.
 - [[#7808](https://github.com/apache/incubator-seata/pull/7808)] Deflake 
multiple Insert Executor tests by fixing order-dependent primary key (PK) value 
comparison
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 18b8107681..aa133e3bbb 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -118,6 +118,7 @@
 - [[#7727](https://github.com/apache/incubator-seata/pull/7727)] 为 compatible 
模块添加单测
 - [[#7803](https://github.com/apache/incubator-seata/pull/7803)] 修复 
`DataCompareUtilsTest` 中因键迭代顺序不稳定导致的测试用例间歇性失败问题。
 - [[#7804](https://github.com/apache/incubator-seata/pull/7804)] 修复 
testXARollbackWithResourceLock() 以确保 CI 正常运行
+- [[#7801](https://github.com/apache/incubator-seata/pull/7801)] 修复 
`JsonParserWrapTest.testToJSONString` 因字段顺序不稳定导致的测试用例间歇性失败问题
 - [[#7800](https://github.com/apache/incubator-seata/pull/7800)] 修复 
`StringUtilsTest.testToStringAndCycleDependency` 因反射字段顺序不稳定导致的测试用例间歇性失败问题
 - [[#7802](https://github.com/apache/incubator-seata/pull/7802)] 修复 
`ConnectionContextProxyTest` 中锁键顺序不稳定导致的测试用例间歇性失败问题。
 - [[#7808](https://github.com/apache/incubator-seata/pull/7808)] 修复多个 Insert 
Executor 单测中因主键值比较顺序导致的间歇性失败问题
diff --git 
a/integration-tx-api/src/test/java/org/apache/seata/integration/tx/api/json/JsonParserWrapTest.java
 
b/integration-tx-api/src/test/java/org/apache/seata/integration/tx/api/json/JsonParserWrapTest.java
index e1852cc08b..6a9fa5501b 100644
--- 
a/integration-tx-api/src/test/java/org/apache/seata/integration/tx/api/json/JsonParserWrapTest.java
+++ 
b/integration-tx-api/src/test/java/org/apache/seata/integration/tx/api/json/JsonParserWrapTest.java
@@ -23,6 +23,7 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -47,7 +48,14 @@ public class JsonParserWrapTest {
 
         String resultString = parserWrap.toJSONString(actionParam);
 
-        assertEquals(jsonString, resultString);
+        TwoPhaseBusinessActionParam deserializedParam =
+                parserWrap.parseObject(resultString, 
TwoPhaseBusinessActionParam.class);
+
+        assertEquals("business_action", deserializedParam.getActionName());
+        assertEquals(BranchType.TCC, deserializedParam.getBranchType());
+        assertNull(deserializedParam.getUseCommonFence());
+        assertNull(deserializedParam.getBusinessActionContext());
+        assertNull(deserializedParam.getDelayReport());
     }
 
     @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to