annhchen89 opened a new pull request, #5948:
URL: https://github.com/apache/accumulo/pull/5948

   ### What does this PR do?
   This PR is fixing a nondeterministic test failure in 
```Upgrader11to12Test.upgradeZooKeeperTest()``` when running with 
[NonDex](https://github.com/TestingResearchIllinois/NonDex)
   
   ### Problem
   The nondeterminism arises because ```RootTabletMetadata.toJson()``` 
delegates to Gson to serialize its internal JSON representation. Gson does not 
guarantee a stable ordering of fields when serializing objects. 
   As a result:
   
   - "version" may appear before or after "columnValues", even though both 
outputs are semantically equivalent.
   
   - The fields inside "columnValues" (e.g., "file", "last", "loc", "srv", 
"~tab") may also appear in different orders for the same reason.
   
   The original test compared raw strings, so it failed under NonDex when the 
order changed.
   
   ### Reproduce Test
   To reproduce the failing test, Nondex can be used:
   
   ```
   mvn -pl server/manager edu.illinois:nondex-maven-plugin:2.2.1:nondex 
-DnondexRuns=10 -Denforcer.skip=true -Dmaven.compiler.failOnWarning=false 
-Dtest=org.apache.accumulo.manager.upgrade.Upgrader11to12Test#upgradeZooKeeperTest
   ```
   
   ### The Fix
   
   Update the test to compare semantic JSON structure instead of raw string 
equality.
   
   - Use ObjectMapper to parse expected and actual JSON strings.
   - Assert equality on version and columnValues nodes, ignoring ordering 
differences.
   


-- 
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]

Reply via email to