swj20010308 opened a new pull request, #2738: URL: https://github.com/apache/fory/pull/2738
## What does this PR do? `ForyCopyTest#mutableObjectCopyTest` assumes that PriorityQueues gurrantees natural ordering in its underlying structure, which can lead to non-deterministic test results. > This class and its iterator implement all of the optional methods of the [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html) and [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html) interfaces. The Iterator provided in method [iterator()](https://docs.oracle.com/javase/8/docs/api/java/util/PriorityQueue.html#iterator--) is not guaranteed to traverse the elements of the priority queue in any particular order. We can reproduce the flakiness with [NonDex](https://github.com/TestingResearchIllinois/NonDex): ``` mvn -pl fory-core edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=org.apache.fory.ForyCopyTest.mutableObjectCopyTest ``` This PR uses `sortedCopyOf()` instead to enforce the ordering of elememts in the new ImmutableList, which removes the flakiness. Similar to #2693 ## 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]
