[BUG] Identified some flaky tests in `core` and `extension` modules
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
### 问题描述
With reference to issues https://github.com/alibaba/fastjson2/issues/2033, https://github.com/alibaba/fastjson2/issues/2029 and https://github.com/alibaba/fastjson2/issues/2017, I can confirm that all flaky tests that were detected in `fastjson1-compatible` module have been addressed.
I have attempted to find tests showing flaky behaviour in other modules of fastjson2 over the last week.
I have identified the following tests to be flaky in the `core` module :
1. `com.alibaba.fastjson2.issues.Issue586#test`
2. `com.alibaba.fastjson2.issues.Issue1411#test5`
3. `com.alibaba.fastjson2.issues_1000.Issue1494#test`
4. `com.alibaba.fastjson2.issues_1000.Issue1401#test`
5. `com.alibaba.fastjson2.v1issues.issue_2400.Issue2430#testForIssue`
6. `com.alibaba.fastjson2.v1issues.issue_2400.Issue2430#testForIssue2`
7. `com.alibaba.fastjson2.issues_1700.Issue1745#test`
8. `com.alibaba.fastjson2.v1issues.issue_1100.Issue1177_2#test_for_issue `
9. `com.alibaba.fastjson2.writer.ObjectWriterSetTest#testJsonbSet`
10. `com.alibaba.fastjson2.issues_1000.Issue1269#test`
11. `com.alibaba.fastjson2.issues_1000.Issue1479#test`
12. `com.alibaba.fastjson2.v1issues.issue_4000.Issue4008#test_for_issue4008`
13. `com.alibaba.fastjson2.v1issues.issue_3800.Issue3824#test_for_issue3824`
14. `com.alibaba.fastjson2.features.MapSortFieldTest#test`
15. `com.alibaba.fastjson2.jackson_support.JsonIncludeTest#test1`
16. `com.alibaba.fastjson2.issues.Issue273#test`
17. `com.alibaba.fastjson2.issues.Issue507#test1`
18. `com.alibaba.fastjson2.v1issues.geo.FeatureCollectionTest#test_geo`
19. `com.alibaba.fastjson2.v1issues.issue_2100.Issue2182#test_for_issue`
I have identified the following test to be flaky in the `extension` module :
1. `com.alibaba.fastjson2.geo.FeatureCollectionTest#test_geo`
### 环境信息
*请填写以下信息:*
- OS信息: [MacOS Sonoma 8GB]
- JDK信息: [JAVA 11.0.21-amzn]
- 版本信息:[2.0.42]
### 重现步骤
*如何操作可以重现该问题:*
Like previous issues, I have confirmed the flaky behavior of the test using [Nondex] and identified the potential root cause for it. I have documented the findings in the forthcoming section.
`com.alibaba.fastjson2.issues.Issue586#test`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.issues.Issue586#test -DnondexMode=ONE`.
- The assertion between `bean.resourceIds` and static text can fail non-deterministically.
- This is because the order of elements in `bean.resourceIds` is not guaranteed to be the same all the time.
```
[INFO] Running com.alibaba.fastjson2.issues.Issue586
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.177 s <<< FAILURE! -- in com.alibaba.fastjson2.issues.Issue586
[ERROR] com.alibaba.fastjson2.issues.Issue586.test -- Time elapsed: 0.161 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <[1,100,1000,1001,1002,1003,1004,1005,1006]> but was: <[1004,1001,1006,1005,1000,1,1002,1003,100]>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.issues.Issue586.test(Issue586.java:15)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue586.test:15 expected: <[1,100,1000,1001,1002,1003,1004,1005,1006]> but was: <[1004,1001,1006,1005,1000,1,1002,1003,100]>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.issues.Issue1411#test5`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.issues.Issue1411#test5 -DnondexMode=ONE`.
- The assertion between `result` and static text can fail non-deterministically.
- This is because the order of elements in `result` is not guaranteed to be the same all the time.
```
[INFO] Running com.alibaba.fastjson2.issues.Issue1411
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.301 s <<< FAILURE! -- in com.alibaba.fastjson2.issues.Issue1411
[ERROR] com.alibaba.fastjson2.issues.Issue1411.test5 -- Time elapsed: 0.276 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"name":"fastjson","id":2}> but was: <{"id":2,"name":"fastjson"}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.issues.Issue1411.test5(Issue1411.java:76)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue1411.test5:76 expected: <{"name":"fastjson","id":2}> but was: <{"id":2,"name":"fastjson"}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.issues_1000.Issue1494#test`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.issues_1000.Issue1494#test -DnondexMode=ONE`.
- The entity `map` is being instantiated with `HashMap<>` and by default, HashMap does not maintain the order of elements stored in it.
- Additionally, there is an assertion of a static JSON with `map` which can again lead to failures should the order of elements not match between the static JSON and `map`.
```
[INFO] Running com.alibaba.fastjson2.issues_1000.Issue1494
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.128 s <<< FAILURE! -- in com.alibaba.fastjson2.issues_1000.Issue1494
[ERROR] com.alibaba.fastjson2.issues_1000.Issue1494.test -- Time elapsed: 0.113 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"qos":0,"tag":"TAG1.cpu","time":1684394501624,"value":37400}> but was: <{"tag":"TAG1.cpu","time":1684394501624,"qos":0,"value":37400}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.issues_1000.Issue1494.test(Issue1494.java:27)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue1494.test:27 expected: <{"qos":0,"tag":"TAG1.cpu","time":1684394501624,"value":37400}> but was: <{"tag":"TAG1.cpu","time":1684394501624,"qos":0,"value":37400}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.issues_1000.Issue1401#test`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.issues_1000.Issue1401#test -DnondexMode=ONE`
- The entity `bean` is being compared with a static JSON and this comparison demands the order of elements in `bean` to match that of the static JSON.
- The order of elements in `bean` is not guaranteed to be the same and hence this behavior introduces some degree of non-determinism to the eventual outcome of the test.
```
[INFO] Running com.alibaba.fastjson2.issues_1000.Issue1401
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.148 s <<< FAILURE! -- in com.alibaba.fastjson2.issues_1000.Issue1401
[ERROR] com.alibaba.fastjson2.issues_1000.Issue1401.test -- Time elapsed: 0.136 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"map":{"0":"Test","null":-1,"-9223372036854775808":"-9223372036854775808","9223372036854775807":"9223372036854775807","2020":2021,"2022":2023}}> but was: <{"map":{"null":-1,"-9223372036854775808":"-9223372036854775808","2020":2021,"0":"Test","9223372036854775807":"9223372036854775807","2022":2023}}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.issues_1000.Issue1401.test(Issue1401.java:33)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue1401.test:33 expected: <{"map":{"0":"Test","null":-1,"-9223372036854775808":"-9223372036854775808","9223372036854775807":"9223372036854775807","2020":2021,"2022":2023}}> but was: <{"map":{"null":-1,"-9223372036854775808":"-9223372036854775808","2020":2021,"0":"Test","9223372036854775807":"9223372036854775807","2022":2023}}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.v1issues.issue_2400.Issue2430#testForIssue`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.v1issues.issue_2400.Issue2430#testForIssue -DnondexMode=ONE`.
- The JSON entity `vo` is being compared with a static JSON which expects both the order and correctness of elements to match for the assertion to execute successfully.
- The order of elements is `vo` is not guaranteed to be the same all the time and hence this causes flakiness.
```
[INFO] Running com.alibaba.fastjson2.v1issues.issue_2400.Issue2430
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.509 s <<< FAILURE! -- in com.alibaba.fastjson2.v1issues.issue_2400.Issue2430
[ERROR] com.alibaba.fastjson2.v1issues.issue_2400.Issue2430.testForIssue -- Time elapsed: 0.484 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"map":{"a":["1","2","3"],"b":["1"]},"name":"zhangsan"}> but was: <{"map":{"b":["1"],"a":["1","2","3"]},"name":"zhangsan"}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.v1issues.issue_2400.Issue2430.testForIssue(Issue2430.java:22)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue2430.testForIssue:22 expected: <{"map":{"a":["1","2","3"],"b":["1"]},"name":"zhangsan"}> but was: <{"map":{"b":["1"],"a":["1","2","3"]},"name":"zhangsan"}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.v1issues.issue_2400.Issue2430#testForIssue2`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.v1issues.issue_2400.Issue2430#testForIssue2 -DnondexMode=ONE`.
- The JSON entity `vo` is being compared with a static JSON which expects both the order and correctness of elements to match for the assertion to execute successfully.
- The order of elements is `vo` is not guaranteed to be the same all the time and hence this causes flakiness.
```
[INFO] Running com.alibaba.fastjson2.v1issues.issue_2400.Issue2430
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.181 s <<< FAILURE! -- in com.alibaba.fastjson2.v1issues.issue_2400.Issue2430
[ERROR] com.alibaba.fastjson2.v1issues.issue_2400.Issue2430.testForIssue2 -- Time elapsed: 0.168 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"map":{"a":["1","2","3"],"b":["1"]},"name":"zhangsan"}> but was: <{"map":{"b":["1"],"a":["1","2","3"]},"name":"zhangsan"}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.v1issues.issue_2400.Issue2430.testForIssue2(Issue2430.java:30)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue2430.testForIssue2:30 expected: <{"map":{"a":["1","2","3"],"b":["1"]},"name":"zhangsan"}> but was: <{"map":{"b":["1"],"a":["1","2","3"]},"name":"zhangsan"}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.issues_1700.Issue1745#test `
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.issues_1700.Issue1745#test -DnondexMode=ONE`.
- The `jsonArray` entity is being compared with a static JSON which expects the order and correctness of the elements to be equal for the assertion to execute successfully.
- The order of elements is not guaranteed in `jsonArray` and hence, this assertion is bound to fail non-deterministically.
```
[INFO] Running com.alibaba.fastjson2.issues_1700.Issue1745
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.157 s <<< FAILURE! -- in com.alibaba.fastjson2.issues_1700.Issue1745
[ERROR] com.alibaba.fastjson2.issues_1700.Issue1745.test -- Time elapsed: 0.141 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <[{"maxFillRatio":{"ref":"不引用","original":100},"minFillRatio":{"ref":"不引用","original":0}}]> but was: <[{"minFillRatio":{"original":0,"ref":"不引用"}Ratio":{"original":100,"ref":"不引用"}}]>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.issues_1700.Issue1745.test(Issue1745.java:42)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue1745.test:42 expected: <[{"maxFillRatio":{"ref":"不引用","original":100},"minFillRatio":{"ref":"不引用","original":0}}]> but was: <[{"minFillRatio":{"original":0,"ref":"不引用"},"maxFilloriginal":100,"ref":"不引用"}}]>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.v1issues.issue_1100.Issue1177_2#test_for_issue `
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.v1issues.issue_1100.Issue1177_2#test_for_issue -DnondexMode=ONE`.
- The `jsonObject` entity is being compared with a static JSON which expects the order and correctness of the elements to be equal for the assertion to execute successfully.
- The order of elements is not guaranteed in `jsonObject` and hence, this assertion is bound to fail non-deterministically.
```
[INFO] Running com.alibaba.fastjson2.v1issues.issue_1100.Issue1177_2
{"b":{"x":"y"},"a":{"x":"y"}}
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.159 s <<< FAILURE! -- in com.alibaba.fastjson2.v1issues.issue_1100.Issue1177_2
[ERROR] com.alibaba.fastjson2.v1issues.issue_1100.Issue1177_2.test_for_issue -- Time elapsed: 0.143 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"a":{"x":"y2"},"b":{"x":"y2"}}> but was: <{"b":{"x":"y2"},"a":{"x":"y2"}}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.v1issues.issue_1100.Issue1177_2.test_for_issue(Issue1177_2.java:25)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue1177_2.test_for_issue:25 expected: <{"a":{"x":"y2"},"b":{"x":"y2"}}> but was: <{"b":{"x":"y2"},"a":{"x":"y2"}}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.writer.ObjectWriterSetTest#testJsonbSet`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.writer.ObjectWriterSetTest#testJsonbSet -DnondexMode=ONE`.
- HashSet by default does not maintain the order of insertion of elements.
- When comparing `str`, a HashSet object with a static set, the chances of the assertion failing owing to change in order of elements in `str` is present.
```
[INFO] Running com.alibaba.fastjson2.writer.ObjectWriterSetTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.135 s <<< FAILURE! -- in com.alibaba.fastjson2.writer.ObjectWriterSetTest
[ERROR] com.alibaba.fastjson2.writer.ObjectWriterSetTest.testJsonbSet -- Time elapsed: 0.125 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <[1,null]> but was: <[null,1]>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.writer.ObjectWriterSetTest.testJsonbSet(ObjectWriterSetTest.java:18)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ObjectWriterSetTest.testJsonbSet:18 expected: <[1,null]> but was: <[null,1]>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.issues_1000.Issue1269#test`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.issues_1000.Issue1269#test -DnondexMode=ONE`.
- The entity `jsonObj` is being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `jsonObj` get shuffled.
```
[INFO] Running com.alibaba.fastjson2.issues_1000.Issue1269
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.161 s <<< FAILURE! -- in com.alibaba.fastjson2.issues_1000.Issue1269
[ERROR] com.alibaba.fastjson2.issues_1000.Issue1269.test -- Time elapsed: 0.150 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"map":{"1":1,"2":2}}> but was: <{"map":{"2":2,"1":1}}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.issues_1000.Issue1269.test(Issue1269.java:23)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue1269.test:23 expected: <{"map":{"1":1,"2":2}}> but was: <{"map":{"2":2,"1":1}}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.issues_1000.Issue1479#test`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.issues_1000.Issue1479#test -DnondexMode=ONE`.
- The entity `student` is being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `student` get shuffled.
```
[INFO] Running com.alibaba.fastjson2.issues_1000.Issue1479
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.239 s <<< FAILURE! -- in com.alibaba.fastjson2.issues_1000.Issue1479
[ERROR] com.alibaba.fastjson2.issues_1000.Issue1479.test -- Time elapsed: 0.211 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"gender":{"remark":"male","value":"M"},"name":"张三"}> but was: <{"gender":{"value":"M","remark":"male"},"name":"张三"}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.issues_1000.Issue1479.test(Issue1479.java:32)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue1479.test:32 expected: <{"gender":{"remark":"male","value":"M"},"name":"张三"}> but was: <{"gender":{"value":"M","remark":"male"},"name":"张三"}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.v1issues.issue_4000.Issue4008#test_for_issue4008`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.v1issues.issue_4000.Issue4008#test_for_issue4008 -DnondexMode=ONE`.
- The entity `fastJSON` is being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `fastJSON` get shuffled.
```
[INFO] Running com.alibaba.fastjson2.v1issues.issue_4000.Issue4008
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.164 s <<< FAILURE! -- in com.alibaba.fastjson2.v1issues.issue_4000.Issue4008
[ERROR] com.alibaba.fastjson2.v1issues.issue_4000.Issue4008.test_for_issue4008 -- Time elapsed: 0.146 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"class":[{"student2":{"sex":"male","name":"jerry"},"student1":{"sex":"male","name":"jerry"}}]}> but was: <{"class":[{"student1":{"name":"jerry","sex":"male"},"student2":{"name":"jerry","sex":"male"}}]}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.v1issues.issue_4000.Issue4008.test_for_issue4008(Issue4008.java:25)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue4008.test_for_issue4008:25 expected: <{"class":[{"student2":{"sex":"male","name":"jerry"},"student1":{"sex":"male","name":"jerry"}}]}> but was: <{"class":[{"student1":{"name":"jerry","sex":"male"},"student2":{"name":"jerry","sex":"male"}}]}>
```
`com.alibaba.fastjson2.v1issues.issue_3800.Issue3824#test_for_issue3824`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.v1issues.issue_3800.Issue3824#test_for_issue3824 -DnondexMode=ONE`.
- The entities `s` and `revert` are being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `s` and `revert` get shuffled.
```
[INFO] Running com.alibaba.fastjson2.v1issues.issue_3800.Issue3824
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.163 s <<< FAILURE! -- in com.alibaba.fastjson2.v1issues.issue_3800.Issue3824
[ERROR] com.alibaba.fastjson2.v1issues.issue_3800.Issue3824.test_for_issue3824 -- Time elapsed: 0.150 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"a.b.c":{"y":{"2_wdk":[{"a":100}]}},"x":{"a":100}}> but was: <{"x":{"a":100},"a.b.c":{"y":{"2_wdk":[{"a":100}]}}}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.v1issues.issue_3800.Issue3824.test_for_issue3824(Issue3824.java:28)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue3824.test_for_issue3824:28 expected: <{"a.b.c":{"y":{"2_wdk":[{"a":100}]}},"x":{"a":100}}> but was: <{"x":{"a":100},"a.b.c":{"y":{"2_wdk":[{"a":100}]}}}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.features.MapSortFieldTest#test`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.features.MapSortFieldTest#test -DnondexMode=ONE`.
- The entity `map2` is being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `map2` get shuffled.
```
[INFO] Running com.alibaba.fastjson2.features.MapSortFieldTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.143 s <<< FAILURE! -- in com.alibaba.fastjson2.features.MapSortFieldTest
[ERROR] com.alibaba.fastjson2.features.MapSortFieldTest.test -- Time elapsed: 0.127 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"v1":1,"v2":2}> but was: <{"v2":2,"v1":1}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.features.MapSortFieldTest.test(MapSortFieldTest.java:35)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] MapSortFieldTest.test:35 expected: <{"v1":1,"v2":2}> but was: <{"v2":2,"v1":1}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.jackson_support.JsonIncludeTest#test1`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.jackson_support.JsonIncludeTest#test1 -DnondexMode=ONE`.
- The entity `str` is being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `str` get shuffled.
```
[INFO] Running com.alibaba.fastjson2.jackson_support.JsonIncludeTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.200 s <<< FAILURE! -- in com.alibaba.fastjson2.jackson_support.JsonIncludeTest
[ERROR] com.alibaba.fastjson2.jackson_support.JsonIncludeTest.test1 -- Time elapsed: 0.185 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"id":101,"name":null}> but was: <{"name":null,"id":101}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.jackson_support.JsonIncludeTest.test1(JsonIncludeTest.java:29)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] JsonIncludeTest.test1:29 expected: <{"id":101,"name":null}> but was: <{"name":null,"id":101}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.issues.Issue273#test`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.issues.Issue273#test -DnondexMode=ONE`.
- The entity `json` is being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `json` get shuffled.
```
[INFO] Running com.alibaba.fastjson2.issues.Issue273
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.171 s <<< FAILURE! -- in com.alibaba.fastjson2.issues.Issue273
[ERROR] com.alibaba.fastjson2.issues.Issue273.test -- Time elapsed: 0.152 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{1:111,2:222}> but was: <{2:222,1:111}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.issues.Issue273.test(Issue273.java:21)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue273.test:21 expected: <{1:111,2:222}> but was: <{2:222,1:111}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.issues.Issue507#test1`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.issues.Issue273#test -DnondexMode=ONE`.
- The entity `str` is being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `str` get shuffled.
```
[INFO] Running com.alibaba.fastjson2.issues.Issue273
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.171 s <<< FAILURE! -- in com.alibaba.fastjson2.issues.Issue273
[ERROR] com.alibaba.fastjson2.issues.Issue273.test -- Time elapsed: 0.152 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{1:111,2:222}> but was: <{2:222,1:111}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.issues.Issue273.test(Issue273.java:21)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue273.test:21 expected: <{1:111,2:222}> but was: <{2:222,1:111}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.v1issues.geo.FeatureCollectionTest#test_geo`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.v1issues.geo.FeatureCollectionTest#test_geo -DnondexMode=ONE `.
- The entity `geometry` is being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `geometry` get shuffled.
```
INFO] Running com.alibaba.fastjson2.v1issues.geo.FeatureCollectionTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.210 s <<< FAILURE! -- in com.alibaba.fastjson2.v1issues.geo.FeatureCollectionTest
[ERROR] com.alibaba.fastjson2.v1issues.geo.FeatureCollectionTest.test_geo -- Time elapsed: 0.196 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"prop0":"value0"},"geometry":{"type":"Point","coordinates":[102.0,0.5]}},{"type":"Feature","properties":{"prop1":"0.0","prop0":"value0"},"geometry":{"type":"LineString","coordinates":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{"type":"Feature","properties":{"prop1":"{\"this\":\"that\"}","prop0":"value0"},"geometry":{"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}> but was: <{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"prop0":"value0"},"geometry":{"type":"Point","coordinates":[102.0,0.5]}},{"type":"Feature","properties":{"prop0":"value0","prop1":"0.0"},"geometry":{"type":"LineString","coordinates":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{"type":"Feature","properties":{"prop0":"value0","prop1":"{\"this\":\"that\"}"},"geometry":{"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.v1issues.geo.FeatureCollectionTest.test_geo(FeatureCollectionTest.java:65)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] FeatureCollectionTest.test_geo:65 expected: <{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"prop0":"value0"},"geometry":{"type":"Point","coordinates":[102.0,0.5]}},{"type":"Feature","properties":{"prop1":"0.0","prop0":"value0"},"geometry":{"type":"LineString","coordinates":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{"type":"Feature","properties":{"prop1":"{\"this\":\"that\"}","prop0":"value0"},"geometry":{"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}> but was: <{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"prop0":"value0"},"geometry":{"type":"Point","coordinates":[102.0,0.5]}},{"type":"Feature","properties":{"prop0":"value0","prop1":"0.0"},"geometry":{"type":"LineString","coordinates":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{"type":"Feature","properties":{"prop0":"value0","prop1":"{\"this\":\"that\"}"},"geometry":{"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.v1issues.issue_2100.Issue2182#test_for_issue`
- Run `mvn -pl core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.v1issues.issue_2100.Issue2182#test_for_issue -DnondexMode=ONE`.
- The entity `json` is being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `json` get shuffled.
```
[INFO] Running com.alibaba.fastjson2.v1issues.issue_2100.Issue2182
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.133 s <<< FAILURE! -- in com.alibaba.fastjson2.v1issues.issue_2100.Issue2182
[ERROR] com.alibaba.fastjson2.v1issues.issue_2100.Issue2182.test_for_issue -- Time elapsed: 0.119 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"admin":["admin.create","admin.update","admin.delete"],"user":["user.create","user.delete"]}> but was: <{"user":["user.create","user.delete"],"admin":["admin.create","admin.update","admin.delete"]}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.v1issues.issue_2100.Issue2182.test_for_issue(Issue2182.java:21)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Issue2182.test_for_issue:21 expected: <{"admin":["admin.create","admin.update","admin.delete"],"user":["user.create","user.delete"]}> but was: <{"user":["user.create","user.delete"],"admin":["admin.create","admin.update","admin.delete"]}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
`com.alibaba.fastjson2.geo.FeatureCollectionTest#test_geo`
- Run `mvn -pl extension edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.alibaba.fastjson2.geo.FeatureCollectionTest#test_geo -DnondexMode=ONE`.
- The entity `geometry` is being compared with a static JSON.
- The comparison enforces strict order and correctness of elements.
- As JSON is not definite in terms of maintaining order of elements, this assertion can fail non-deterministically should the order of elements in `geometry` get shuffled.
```
[INFO] Running com.alibaba.fastjson2.geo.FeatureCollectionTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.152 s <<< FAILURE! -- in com.alibaba.fastjson2.geo.FeatureCollectionTest
[ERROR] com.alibaba.fastjson2.geo.FeatureCollectionTest.test_geo -- Time elapsed: 0.143 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"prop0":"value0"},"geometry":{"type":"Point","coordinates":[102.0,0.5]}},{"type":"Feature","properties":{"prop1":"0.0","prop0":"value0"},"geometry":{"type":"LineString","coordinates":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{"type":"Feature","properties":{"prop1":"{\"this\":\"that\"}","prop0":"value0"},"geometry":{"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}> but was: <{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"prop0":"value0"},"geometry":{"type":"Point","coordinates":[102.0,0.5]}},{"type":"Feature","properties":{"prop0":"value0","prop1":"0.0"},"geometry":{"type":"LineString","coordinates":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{"type":"Feature","properties":{"prop0":"value0","prop1":"{\"this\":\"that\"}"},"geometry":{"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at com.alibaba.fastjson2.geo.FeatureCollectionTest.test_geo(FeatureCollectionTest.java:65)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] FeatureCollectionTest.test_geo:65 expected: <{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"prop0":"value0"},"geometry":{"type":"Point","coordinates":[102.0,0.5]}},{"type":"Feature","properties":{"prop1":"0.0","prop0":"value0"},"geometry":{"type":"LineString","coordinates":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{"type":"Feature","properties":{"prop1":"{\"this\":\"that\"}","prop0":"value0"},"geometry":{"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}> but was: <{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"prop0":"value0"},"geometry":{"type":"Point","coordinates":[102.0,0.5]}},{"type":"Feature","properties":{"prop0":"value0","prop1":"0.0"},"geometry":{"type":"LineString","coordinates":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{"type":"Feature","properties":{"prop0":"value0","prop1":"{\"this\":\"that\"}"},"geometry":{"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
```
### 期待的正确结果
- For all the mentioned tests that could fail because of comparing json objects with static JSON strings, it is necessary to modify the assertion to validate not only the contents of the JSON elements but also their order.
- For tests that are using HashMap or HashSet to store content, we can switch those to LinkedHashMap or LinkedHashSet to maintain order of element insertion.
### 相关日志输出
The relevant log extracts have been attached in the issue description section.
#### 附加信息
Contributor guide
Research direction
Start with the listed core and extension test entry points, reproducing failures with the provided Maven Nondex command, such as Issue586#test and Issue1411#test5. Compare each failing assertion with the reported ordering cause and address the identified flaky tests. Done means the listed tests no longer fail nondeterministically under Nondex.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100