Skip to content

Conversation

@yonghanlin
Copy link
Contributor

@yonghanlin yonghanlin commented Oct 3, 2025

A failure occurred in testPriorityQueueSubclass() and testPriorityQueue() in both the main and main-versioned modules when using NonDex to run these commands:

mvn -pl main-versioned edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.esotericsoftware.kryo.serializers.DefaultSerializersTest#testPriorityQueueSubclass
mvn -pl main-versioned edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.esotericsoftware.kryo.serializers.DefaultSerializersTest#testPriorityQueue
mvn -pl main edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.esotericsoftware.kryo.serializers.DefaultSerializersTest#testPriorityQueueSubclass
mvn -pl main edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.esotericsoftware.kryo.serializers.DefaultSerializersTest#testPriorityQueue

Reasons for the failure:
A PriorityQueue in Java is backed by a binary heap, which guarantees the smallest element can be accessed quickly but does not guarantee iteration order. When converted to a list, two queues with the same elements can produce different sequences depending on their internal heap structure. The original doAssertEquals used assertEquals on the lists, which compared both order and contents, so the tests failed even though the queues contained the same elements.

The Fix:
Updated doAssertEquals to handle list comparison by first checking list sizes to ensure element counts match. Then verifying that each list contains all elements of the other, ignoring order. For non-list values, the original assertEquals is preserved.

@theigl theigl merged commit 3b71013 into EsotericSoftware:master Oct 3, 2025
1 check passed
@theigl
Copy link
Collaborator

theigl commented Oct 3, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants