Anshul-creator opened a new pull request, #15777:
URL: https://github.com/apache/dubbo/pull/15777
## What is the purpose of the change?
This PR stabilizes `"map argument body test"` and `"advance bean argument
get test"` inside `RestProtocolTest.groovy` that were exhibiting
order-dependent flakiness when asserting on map and nested-bean argument
serialization output. These tests failed intermittently under randomized
execution orders, JVM differences, and NonDex mutated iteration orders.
## Root Cause
These test assertions depended on strict substring matching of complete JSON
fragments, assuming a fixed deterministic field order during serialization.
However, JSON object key ordering is not guaranteed, and the internal map/bean
population logic may result in different field iteration orders. This caused
nondeterministic failures.
## Changes Made
- Updated `"map argument body test"` to assert key/value presence
independently rather than asserting on a single ordered JSON substring.
- Updated selected rows of `"advance bean argument get test"` to use
order-insensitive fragment assertions for map and nested-map responses.
- Retained existing test signatures, input parameters, and expected logical
outcomes.
## Verification
You can try running the following snippet of code from the dubbo repo root,
on both pre-fix and post-fix code
```bash
./mvnw -q -pl dubbo-rpc/dubbo-rpc-triple
edu.illinois:nondex-maven-plugin:2.2.1:nondex \
-DnondexRuns=50 \
-Dtest=org.apache.dubbo.rpc.protocol.tri.rest.support.basic.RestProtocolTest
```
The tests should fail intermittently on the pre-fix version, but pass
consistently across all seeds on the post-fix version.
NonDex run logs will be available under the
`dubbo-rpc/dubbo-rpc-triple/.nondex` directory.
## Checklist
- [x] Make sure there is a
[GitHub_issue](https://github.com/apache/dubbo/issues) field for the change.
- [x] Write a pull request description that is detailed enough to understand
what the pull request does, how, and why.
- [x] Write necessary unit-test to verify your logic correction. If the new
feature or significant change is committed, please remember to add sample in
[dubbo samples](https://github.com/apache/dubbo-samples) project.
- [x] Make sure gitHub actions can pass. [Why the workflow is failing and
how to fix it?](../CONTRIBUTING.md)
--
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]