annhchen89 opened a new pull request, #5961:
URL: https://github.com/apache/accumulo/pull/5961
### What does this PR do?
This PR is fixing a nondeterministic test failure in
`LoadPlanTest.testJson()` when running with Nondex.
### Problem
Previously, the test used:
```java
assertEquals(expected.replace("'", "\""), json);
```
This approach directly compared JSON strings. However, JSON object field
order is nondeterministic, and NonDex randomizes iteration orders.
As a result, the test failed when field order in the generated JSON differed
from the expected literal string, even though both represented the same
structure.
### Reproduce Test
Run:
```bash
mvn edu.illinois:nondex-maven-plugin:2.2.1:nondex -pl core
-Dtest=org.apache.accumulo.core.data.LoadPlanTest#testJson
```
### The Fix
Instead of comparing JSON strings directly, the test now parses both
expected and actual JSON into `JsonNode` objects and asserts structural
equality. This ensures the comparison is **order-independent** and validates
actual JSON semantics, not textual layout.
--
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]