You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apache Maven 3.6.3
Ubuntu 20.04.6 LTS
Linux version: 5.4.0-163-generic
Description
There are 9 tests within json-io has been reported as flaky when run with the NonDextool.
Since hashmap in Java is unordered, we simulate the randomness of the hashmap by shuffling it to test the correctness of the tests in json-io. There may be more than one json string when hashmap is used.
For example: com.cedarsoftware.util.io.AtomicLongTest,testAssignAtomicLong
Tests should not rely on the getDeclaredFields() function because according to Class.getDeclaredFields() "The elements in the returned array are not sorted and are not in any particular order.". The test answers can differ.
For example: com.cedarsoftware.util.io.MapsTest,testMap
json-io version
Java version
Used tools
Description
There are 9 tests within json-io has been reported as flaky when run with the NonDextool.
Since hashmap in Java is unordered, we simulate the randomness of the hashmap by shuffling it to test the correctness of the tests in json-io. There may be more than one json string when hashmap is used.
For example: com.cedarsoftware.util.io.AtomicLongTest,testAssignAtomicLong
Tests should not rely on the getDeclaredFields() function because according to Class.getDeclaredFields() "The elements in the returned array are not sorted and are not in any particular order.". The test answers can differ.
For example: com.cedarsoftware.util.io.MapsTest,testMap
Expected behavior
Test should pass even if the order in json string differs.
Actual behavior
The tests assume there will only one json string produced by TestUtil.toJson function. But after shuffling, they failed.
Reproduction steps
Full description of Nondex please refer to its doc on github.
Thanks
The text was updated successfully, but these errors were encountered: