Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-deterministic tests for issue#3149 #3150

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Conversation

Mukta13
Copy link
Contributor

@Mukta13 Mukta13 commented Nov 5, 2024

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:

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

Checklist

  • Ensured all tests are passing and test coverage is added where necessary.
  • Verified that commit messages adhere to the Conventional Commits specification.
  • Considered the documentation impact, and if needed, created or updated documentation accordingly.

@wenshao wenshao merged commit 2da286c into alibaba:main Nov 5, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants