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

[BUG] Non deterministic tests found #3165

Closed
Mukta13 opened this issue Nov 18, 2024 · 1 comment
Closed

[BUG] Non deterministic tests found #3165

Mukta13 opened this issue Nov 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Mukta13
Copy link
Contributor

Mukta13 commented Nov 18, 2024

Problem Description

The following files contain non-deterministic tests:

  • QuickConfigTest2.java
  • QuickConfigTest.java
  • UtilTypeTest.java

The specific flaky tests in these files are:

  • hello2() in QuickConfigTest2.java (two instances)
  • hello2() in QuickConfigTest.java
  • test() in UtilTypeTest.java (timezone-dependent issue)

Environment Info

  • OS: Ubuntu 22.04.5 LTS, Release: 22.04
  • JDK: java-17-openjdk-amd64
  • Version: Latest version

Steps to Reproduce

Run the following commands for each identified flaky test to observe non-deterministic failures:

  1. For QuickConfigTest2.java:
mvn -pl extension-solon edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.support.solon.test.config.test1.QuickConfigTest2#hello2
  1. For QuickConfigTest.java:
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

  1. For UtilTypeTest.java:
mvn -pl codegen-test edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.internal.processor.primitives.UtilTypeTest#test

Observed Results

The following non-deterministic errors were observed during test runs:

  1. QuickConfigTest2.java:
    [ERROR] QuickConfigTest2.hello2: expected: <{"values":{"b1":1,"d1":1.0,"map1":{"long":"12","time":"2023-01-16 17:39:53","int":12},"n1":"1","s1":"noear"}}> but was: <{"values":{"long":"1","order":{"orderId":"2"}}}>

  2. QuickConfigTest.java:
    [ERROR] QuickConfigTest.hello2: expected: <{"values":{"b1":1,"d1":1.0,"map1":{"long":"12","time":"2023-01-16 17:39:53","int":12},"n1":"1","s1":"noear"}}> but was: <{"values":{"long":"1","order":{"orderId":"2"}}}>

  3. UtilTypeTest.java:
    [ERROR] UtilTypeTest.test: expected: <java.util.GregorianCalendar[time=1731865085636, areFieldsSet=true, zone=sun.util.calendar.ZoneInfo[id="Asia/Shanghai", offset=28800000, dstSavings=0]> but was: <java.util.GregorianCalendar[time=1731814685636, areFieldsSet=true, zone=sun.util.calendar.ZoneInfo[id="Asia/Shanghai", offset=28800000, dstSavings=0]>

Expected Results

All tests should pass consistently without non-deterministic failures, and the build should succeed after running the above commands.

@Mukta13 Mukta13 added the bug Something isn't working label Nov 18, 2024
@Mukta13
Copy link
Contributor Author

Mukta13 commented Nov 18, 2024

Fix in #3166

@Mukta13 Mukta13 closed this as completed Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant