aditya-kumbhar opened a new pull request, #398:
URL: https://github.com/apache/incubator-hugegraph-toolchain/pull/398

   ### Motivation
   IndexLabelTest has the following tests that are flaky, detected using the 
[NonDex](https://github.com/TestingResearchIllinois/NonDex) tool:
   org.apache.hugegraph.unit.IndexLabelTest#testIndexLabel
   org.apache.hugegraph.unit.IndexLabelTest#testIndexLabelV49
   org.apache.hugegraph.unit.IndexLabelTest#testIndexLabelV56
   
   The tests fail due to non-deterministic ordering of the properties in the 
JSON string created by the `JsonUtil.toJson()` method.
   
   ### Command to reproduce
   mvn -pl hugegraph-client edu.illinois:nondex-maven-plugin:2.1.1:nondex 
-Dtest=org.apache.hugegraph.unit.IndexLabelTest
   
   ### Log
   ```
   [ERROR]   IndexLabelTest.testIndexLabel:47 
expected:<...ame":"personByAge","[id":0,"check_exist":true,"user_data":{},"base_type":"VERTEX_LABEL","base_value":"person","index_type":"SECONDARY","fields":["age"],"rebuild":true]}>
 but 
was:<...ame":"personByAge","[check_exist":true,"user_data":{},"id":0,"fields":["age"],"base_value":"person","rebuild":true,"index_type":"SECONDARY","base_type":"VERTEX_LABEL"]}>
   
   [ERROR]   IndexLabelTest.testIndexLabelV49:66 
expected:<{"id":0,"[name":"personByAge","check_exist":true],"base_type":"VERTEX...>
 but 
was:<{"id":0,"[check_exist":true,"name":"personByAge"],"base_type":"VERTEX...>
   
   [ERROR]   IndexLabelTest.testIndexLabelV56:88 
expected:<{"[id":0,"name":"personByAge","check_exist":true,"user_data":{},"base_type":"VERTEX_LABEL","base_value":"person","index_type":"SECONDARY]","fields":["age"]}>
 but 
was:<{"[name":"personByAge","id":0,"check_exist":true,"user_data":{},"index_type":"SECONDARY","base_type":"VERTEX_LABEL","base_value":"person]","fields":["age"]}>
   ```
   
   ### Changes
   Using the jackson ObjectMapper, comparing the JSONNodes instead of raw json 
strings would make the test deterministic, as the order of the properties will 
not be compared.


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