AmitPr opened a new pull request, #1968:
URL: https://github.com/apache/fury/pull/1968

   ## What does this PR do?
   
   `ExpressionVisitorTest#testTraverseExpression` relies on ordered traversal. 
However, the traversal depends on the order of `getDeclaredFields()` to be 
deterministic (see below). The Java specification explicitly marks 
`getDeclaredFields` as a function that can return field names in any order. In 
the wild, this is most likely to manifest on different architectures with 
different JVM versions.
   
   
https://github.com/apache/fury/blob/54b62fb6ab5d7e557131efe07c7402c885f6e7c4/java/fury-core/src/main/java/org/apache/fury/reflect/ReflectionUtils.java#L368-L381
   
   Using [NonDex](https://github.com/TestingResearchIllinois/NonDex), we can 
replicate the flaky behavior with the following command:
   
   ```
   mvn edu.illinois:nondex-maven-plugin:2.1.7:nondex -pl fury-core/ 
-Dcheckstyle.skip -Dmaven.javadoc.skip 
-Dtest=org.apache.fury.codegen.ExpressionVisitorTest
   ```
   
   The fix, in this case, is to simply use HashSet equality instead of an 
ordered List equality. The above NonDex command should succeed after applying 
this patch.
   
   I do, however, note that there are other flaky tests (found by running 
NonDex on the entire `fury-core` project) that fail due to reliance on e.g. 
`PriorityQueue#toArray`, which is also explicity marked to return 
nondeterministically ordered arrays.
   
   ## Does this PR introduce any user-facing change?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to