You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/04/25 15:35:22 UTC

[GitHub] [iotdb] MarcyGO opened a new pull request, #5666: Change assertion to prevent IoTDBInterpreterTest from failing due to indeterminate ordering

MarcyGO opened a new pull request, #5666:
URL: https://github.com/apache/iotdb/pull/5666

   Some tests in the class `org.apache.zeppelin.iotdb.IoTDBInterpreterTest` can fail based on the order of iteration in `ConcurrentHashMap`. These tests are `testShowTimeseries`, `testShowDevices`, `testShowDevicesWithSg`, `testShowAllTTL`, and `testShowStorageGroup`.
   
   I found the issue using [NonDex](https://github.com/TestingResearchIllinois/NonDex):
   ```
   mvn test-compile -pl tsfile -am
   mvn -pl Zeppelin-interpreter edu.illinois:nondex-maven-plugin:1.1.2:nondex -Dtest=org.apache.zeppelin.iotdb.IoTDBInterpreterTest
   ```
   The test can fail because it assumes that the order of the data is determinate, and can be fixed it by ignoring the order.


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] jixuan1989 commented on a diff in pull request #5666: Change assertion to prevent IoTDBInterpreterTest from failing due to indeterminate ordering

Posted by GitBox <gi...@apache.org>.
jixuan1989 commented on code in PR #5666:
URL: https://github.com/apache/iotdb/pull/5666#discussion_r862338619


##########
zeppelin-interpreter/src/test/java/org/apache/zeppelin/iotdb/IoTDBInterpreterTest.java:
##########
@@ -389,4 +393,11 @@ public void testListUser() {
     Assert.assertEquals(Code.SUCCESS, actual.code());
     Assert.assertEquals(gt, actual.message().get(0).getData());
   }
+
+  private void assertEqualsNonStrict(String gt, String actual) {
+    List<String> actualList = new ArrayList<String>(Arrays.asList(actual.split("\n")));
+    List<String> expectedList = new ArrayList<String>(Arrays.asList(gt.split("\n")));
+    Assert.assertEquals(expectedList.get(0), actualList.get(0));
+    Assert.assertEquals(new HashSet<String>(expectedList), new HashSet<String>(actualList));

Review Comment:
   This modification has a benifit that we can know which line of results are incorrect.
   However, IMO, it is sensitive about the order of the resultset table. 
   So, using Hashset to compare the result is not very good. 
   We may need to use ArrayList to split the result and compare them line by line.



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] HTHou closed pull request #5666: Change assertion to prevent IoTDBInterpreterTest from failing due to indeterminate ordering

Posted by "HTHou (via GitHub)" <gi...@apache.org>.
HTHou closed pull request #5666: Change assertion to prevent IoTDBInterpreterTest from failing due to indeterminate ordering
URL: https://github.com/apache/iotdb/pull/5666


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org