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 in extension-solon module #3166

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

Mukta13
Copy link
Contributor

@Mukta13 Mukta13 commented Nov 18, 2024

What this PR does / why we need it

This PR fixes non-deterministic behavior in multiple specific files, ensuring consistent and reliable results across different builds. This resolves issue #3158

Summary of Changes

  • Modified Flaky Tests:
    • QuickConfigTest2.java:

      • Updated hello2() to ensure consistent behavior for the test.
    • QuickConfigTest.java:

      • Adjusted hello2() to handle non-deterministic behavior, ensuring reliable results.
    • UtilTypeTest.java:

      • Fixed the expected and actual GregorianCalendar comparison to eliminate timezone discrepancies, ensuring matching expected and actual values.

Testing Instructions

The changes can be validated using the NonDex plugin to simulate non-deterministic behavior:

mvn -pl extension-solon edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.support.solon.test.config.test1.QuickConfigTest2#hello2
mvn -pl extension-solon edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.support.solon.test.config.test1.QuickConfigTest#hello2
mvn -pl extension-solon edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.support.solon.test.config.test0.QuickConfigTest#hello2
mvn -pl extension-solon edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.support.solon.test.config.test2.QuickConfigTest#hello2
mvn -pl codegen-test edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.internal.processor.primitives.UtilTypeTest#test

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 2a898e6 into alibaba:main Nov 19, 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