Skip to content

Commit ba287a9

Browse files
authored
Fix SHOW DEVICES limit offset test ordering (#18745)
1 parent 79631e3 commit ba287a9

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,13 @@ public void testShowDevicesWithLimitOffset() throws SQLException {
10201020
try (Connection connection = EnvFactory.getEnv().getConnection();
10211021
Statement statement = connection.createStatement()) {
10221022
try {
1023-
List<String> exps = Arrays.asList("root.sg1.d1,false", "root.sg1.d2,false");
1023+
List<String> exps =
1024+
new ArrayList<>(
1025+
Arrays.asList(
1026+
"root.sg1.d0,false",
1027+
"root.sg1.d1,false",
1028+
"root.sg1.d2,false",
1029+
"root.sg1.d3,false"));
10241030

10251031
statement.execute("INSERT INTO root.sg1.d0(timestamp, s1) VALUES (5, 5)");
10261032
statement.execute("INSERT INTO root.sg1.d1(timestamp, s2) VALUES (5, 5)");
@@ -1030,8 +1036,8 @@ public void testShowDevicesWithLimitOffset() throws SQLException {
10301036
int count = 0;
10311037
try (ResultSet resultSet = statement.executeQuery("show devices limit 2 offset 1")) {
10321038
while (resultSet.next()) {
1033-
Assert.assertEquals(
1034-
exps.get(count), resultSet.getString(1) + "," + resultSet.getString(2));
1039+
String device = resultSet.getString(1) + "," + resultSet.getString(2);
1040+
Assert.assertTrue(device, exps.remove(device));
10351041
++count;
10361042
}
10371043
}

0 commit comments

Comments
 (0)