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 flaky test in issue#3096 #3097

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Fix flaky test in issue#3096 #3097

merged 1 commit into from
Oct 17, 2024

Conversation

Mukta13
Copy link
Contributor

@Mukta13 Mukta13 commented Oct 12, 2024

What this PR does / why we need it?

The fix for: #3096

Summary of your change

This change introduces a helper method, assertMapsEqual(), that reduces test flakiness by serializing two objects to JSON, converting them into maps, and comparing their content. It ensures stable data comparison by avoiding issues with non-deterministic behavior or inconsistent serialization. Error handling is added to manage potential serialization failures.

Can be tested by running:

mvn -pl core edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.codec.JSONBTableTest3#test_0


mvn -pl core edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.codec.JSONBTableTest3#test_1

Please indicate you've done the following:

  • [yes ] Made sure tests are passing and test coverage is added if needed.
  • [yes ] Made sure commit message follow the rule of Conventional Commits specification.
  • [ yes] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@CLAassistant
Copy link

CLAassistant commented Oct 12, 2024

CLA assistant check
All committers have signed the CLA.

@Mukta13
Copy link
Contributor Author

Mukta13 commented Oct 17, 2024

Hi. Can this PR be reviewed as well? Thanks!! @wenshao

@wenshao wenshao merged commit 4d71c70 into alibaba:main Oct 17, 2024
1 of 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.

3 participants