The GitHub Actions job "Sync Files" on fory.git/main has failed.
Run started by GitHub user chaokunyang (triggered by chaokunyang).

Head commit for run:
ec7b96cbd69a04cb220967d3e33ef543a5767176 / JACKDABOSS 
<[email protected]>
fix(java): Fix flakiness in ForyCopyTest#mutableObjectCopyTest (#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

Report URL: https://github.com/apache/fory/actions/runs/18394130230

With regards,
GitHub Actions via GitBox


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

Reply via email to