Skip to content

[Bug] ThreadPoolStatusCheckerTest#test fails when collection order is shuffled with NonDex #16152

@Archonic944

Description

@Archonic944

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo Java 3.3.7-SNAPSHOT, OpenJDK 23.0.2, macOS 15.7.3

Steps to reproduce this issue

Run tests in the dubbo-rpc/dubbo-rpc-dubbo using NonDex: mvn edu.illinois:nondex-maven-plugin:2.2.1:nondex -pl dubbo-rpc/dubbo-rpc-dubbo -Dtest=org.apache.dubbo.rpc.protocol.dubbo.status.ThreadPoolStatusCheckerTest#test -DnondexRuns=10

About 50% of the time, the test will fail.

21:46:13.213 |-INFO  [main] mmon.utils.SerializeSecurityConfigurator:166 -|  [DUBBO] Read serialize blocked list from jar:file:/Users/gabriel/.m2/repository/org/apache/dubbo/dubbo-common/3.3.7-SNAPSHOT/dubbo-common-3.3.7-SNAPSHOT.jar!/security/serialize.blockedlist, dubbo version: 3.3.7-SNAPSHOT, current host: 10.214.1.225
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.577 s <<< FAILURE! -- in org.apache.dubbo.rpc.protocol.dubbo.status.ThreadPoolStatusCheckerTest
[ERROR] org.apache.dubbo.rpc.protocol.dubbo.status.ThreadPoolStatusCheckerTest.test -- Time elapsed: 0.565 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <Pool status:OK, max:10, core:10, largest:0, active:0, task:0, service port: 8889;Pool status:WARN, max:1, core:1, largest:0, active:0, task:0, service port: 8888> but was: <Pool status:WARN, max:1, core:1, largest:0, active:0, task:0, service port: 8888;Pool status:OK, max:10, core:10, largest:0, active:0, task:0, service port: 8889>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
	at org.apache.dubbo.rpc.protocol.dubbo.status.ThreadPoolStatusCheckerTest.test(ThreadPoolStatusCheckerTest.java:48)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   ThreadPoolStatusCheckerTest.test:48 expected: <Pool status:OK, max:10, core:10, largest:0, active:0, task:0, service port: 8889;Pool status:WARN, max:1, core:1, largest:0, active:0, task:0, service port: 8888> but was: <Pool status:WARN, max:1, core:1, largest:0, active:0, task:0, service port: 8888;Pool status:OK, max:10, core:10, largest:0, active:0, task:0, service port: 8889>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

What you expected to happen

The test should have passed. NonDex shuffles internal collection order in a way that is acceptable by Java specifications. This test relies on Map<String, Object> being in insertion order during iteration, which happens to succeed most of the time due to the limited nature of the test.

Anything else

I am about to open a pull request.

Do you have a (mini) reproduction demo?

  • Yes, I have a minimal reproduction demo to help resolve this issue more effectively!

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedEverything needs help from contributors

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions