Closed Mukta13 closed 1 week ago
This PR addresses non-deterministic behavior in two specific tests, ensuring consistent and predictable results across builds.
Modified Flaky Tests:
Issue2959.java:
Updated test() to enforce a consistent ordering of fields in the expected output, matching it with the actual output format.
test()
DubboTest4.java:
Adjusted test6() to handle expected exceptions properly, accounting for specific exceptions (e.g., java.io.IOException) rather than returning null.
test6()
java.io.IOException
The modifications can be validated using the NonDex plugin to simulate non-deterministic behavior:
mvn -pl core edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.issues_2900.Issue2959 mvn -pl core edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.dubbo.DubboTest4#test6
What this PR does / why we need it
This PR addresses non-deterministic behavior in two specific tests, ensuring consistent and predictable results across builds.
Summary of Changes
Modified Flaky Tests:
Issue2959.java:
Updated
test()
to enforce a consistent ordering of fields in the expected output, matching it with the actual output format.DubboTest4.java:
Adjusted
test6()
to handle expected exceptions properly, accounting for specific exceptions (e.g.,java.io.IOException
) rather than returning null.Testing Instructions
The modifications can be validated using the NonDex plugin to simulate non-deterministic behavior:
Checklist