Fix: Stabilize "map argument body test" and "advance bean argument get test" in RestProtocolTest.groovy
#15777
+43
−32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change?
This PR stabilizes
"map argument body test"and"advance bean argument get test"insideRestProtocolTest.groovythat 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
"map argument body test"to assert key/value presence independently rather than asserting on a single ordered JSON substring."advance bean argument get test"to use order-insensitive fragment assertions for map and nested-map responses.Verification
You can try running the following snippet of code from the dubbo repo root, on both pre-fix and post-fix code
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/.nondexdirectory.Checklist