apache / iotdb

Apache IoTDB
https://iotdb.apache.org/
Apache License 2.0
5.63k stars 1.03k forks source link

Fixed a non deterministic test in StatementGeneratorTest #14170

Open yugvajani opened 1 week ago

yugvajani commented 1 week ago

Description

This PR fixes the non deterministic test :

org.apache.iotdb.db.queryengine.plan.parser.StatementGeneratorTest.testCreateSchemaTemplate

This tests failed under NonDex tool as explained in the issue IOTDB-6352 .

Steps to Reproduce

To reproduce the problem, first build the module and then run the nondex command:

mvn install -pl iotdb-core/datanode -am -DskipTests

mvn -pl iotdb-core/datanode edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=org.apache.iotdb.db.queryengine.plan.parser.StatementGeneratorTest#testCreateSchemaTemplate

The reason for the flakiness of this test is due to non-deterministic order of the measurements returned by the function statement.getMeasurements(). Fixed the issue by comparing the measurements as Set instead of List as Set ensures a deterministic order.

Please let me know if you have any questions or need any additional justification/changes from my side.


This PR has:


Key changed/added classes (or packages if there are too many classes) in this PR