Skip to content

Commit 3fab712

Browse files
committed
fix tests
1 parent 7e5c889 commit 3fab712

3 files changed

Lines changed: 20 additions & 16 deletions

File tree

integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtension2IT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.apache.iotdb.commons.client.exception.ClientManagerException;
2525
import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
2626
import org.apache.iotdb.commons.cluster.NodeStatus;
27+
import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
2728
import org.apache.iotdb.confignode.it.utils.ConfigNodeTestUtils;
2829
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionReq;
2930
import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionTableResp;
@@ -147,6 +148,7 @@ public void testAutoRegionGroupExtensionPolicy2()
147148

148149
// Check DataRegionGroups
149150
TShowRegionResp resp = client.showRegion(new TShowRegionReq());
151+
resp.getRegionInfoList().removeIf(r -> r.getDatabase().startsWith(SystemConstant.SYSTEM_DATABASE));
150152
Map<Integer, AtomicInteger> counter = new HashMap<>();
151153
resp.getRegionInfoList()
152154
.forEach(

integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ private void checkRegionDistribution(
176176
Map<String, Integer> databaseRegionCounter = new TreeMap<>();
177177
Map<Integer, Integer> dataNodeRegionCounter = new TreeMap<>();
178178
Map<String, Map<Integer, Integer>> databaseDataNodeRegionCounter = new TreeMap<>();
179-
resp.getRegionInfoList().removeIf(r -> r.database.equals(SystemConstant.SYSTEM_DATABASE));
180179
resp.getRegionInfoList()
181180
.forEach(
182181
regionInfo -> {
@@ -187,7 +186,8 @@ private void checkRegionDistribution(
187186
.merge(regionInfo.getDataNodeId(), 1, Integer::sum);
188187
});
189188
// The number of RegionGroups should not less than the testMinRegionGroupNum for each database
190-
Assert.assertEquals(TEST_DATABASE_NUM, databaseRegionCounter.size());
189+
// +1 for system database
190+
Assert.assertEquals(TEST_DATABASE_NUM + 1, databaseRegionCounter.size());
191191
databaseRegionCounter.forEach(
192192
(database, regionCount) ->
193193
Assert.assertTrue(
@@ -199,13 +199,15 @@ private void checkRegionDistribution(
199199
// DataNode
200200
Assert.assertEquals(TEST_DATA_NODE_NUM, dataNodeRegionCounter.size());
201201
System.out.println(databaseRegionCounter);
202+
System.out.println(dataNodeRegionCounter);
202203
Assert.assertTrue(
203204
dataNodeRegionCounter.values().stream().max(Integer::compareTo).orElse(0)
204205
- dataNodeRegionCounter.values().stream().min(Integer::compareTo).orElse(0)
205206
<= 1);
206207
// The maximal Region count - minimal Region count should be less than or equal to 1 for each
207208
// Database
208-
Assert.assertEquals(TEST_DATABASE_NUM, databaseDataNodeRegionCounter.size());
209+
// +1 for system database
210+
Assert.assertEquals(TEST_DATABASE_NUM + 1, databaseDataNodeRegionCounter.size());
209211
databaseDataNodeRegionCounter.forEach(
210212
(database, dataNodeRegionCount) ->
211213
Assert.assertTrue(

integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeIdempotentIT.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void testDeleteTimeSeriesIdempotent() throws Exception {
175175
"create database root.sg",
176176
"count databases",
177177
"count,",
178-
Collections.singleton("2,"));
178+
Collections.singleton("3,"));
179179
}
180180

181181
@Test
@@ -186,7 +186,7 @@ public void testCreateTemplateIdempotent() throws Exception {
186186
"create database root.sg1",
187187
"count databases",
188188
"count,",
189-
Collections.singleton("1,"));
189+
Collections.singleton("2,"));
190190
}
191191

192192
@Test
@@ -198,7 +198,7 @@ public void testExtendTemplateIdempotent() throws Exception {
198198
"create database root.sg1",
199199
"count databases",
200200
"count,",
201-
Collections.singleton("1,"));
201+
Collections.singleton("2,"));
202202
}
203203

204204
@Test
@@ -210,7 +210,7 @@ public void testDropTemplateIdempotent() throws Exception {
210210
"create database root.sg1",
211211
"count databases",
212212
"count,",
213-
Collections.singleton("1,"));
213+
Collections.singleton("2,"));
214214
}
215215

216216
@Test
@@ -223,7 +223,7 @@ public void testSetTemplateIdempotent() throws Exception {
223223
"create database root.sg2",
224224
"count databases",
225225
"count,",
226-
Collections.singleton("2,"));
226+
Collections.singleton("3,"));
227227
}
228228

229229
@Test
@@ -237,7 +237,7 @@ public void testUnsetTemplateIdempotent() throws Exception {
237237
"create database root.sg2",
238238
"count databases",
239239
"count,",
240-
Collections.singleton("2,"));
240+
Collections.singleton("3,"));
241241
}
242242

243243
@Test
@@ -267,7 +267,7 @@ public void testDeactivateTemplateIdempotent() throws Exception {
267267
"create database root.sg2",
268268
"count databases",
269269
"count,",
270-
Collections.singleton("2,"));
270+
Collections.singleton("3,"));
271271
}
272272

273273
@Test
@@ -278,7 +278,7 @@ public void testCreateDatabaseIdempotent() throws Exception {
278278
"create database root.sg2",
279279
"count databases",
280280
"count,",
281-
Collections.singleton("2,"));
281+
Collections.singleton("3,"));
282282
}
283283

284284
@Test
@@ -289,7 +289,7 @@ public void testAlterDatabaseIdempotent() throws Exception {
289289
"create database root.sg2",
290290
"count databases",
291291
"count,",
292-
Collections.singleton("2,"));
292+
Collections.singleton("3,"));
293293
}
294294

295295
@Test
@@ -300,7 +300,7 @@ public void testDropDatabaseIdempotent() throws Exception {
300300
"create database root.sg2",
301301
"count databases",
302302
"count,",
303-
Collections.singleton("1,"));
303+
Collections.singleton("2,"));
304304
}
305305

306306
@Test
@@ -322,7 +322,7 @@ public void testCreateRoleIdempotent() throws Exception {
322322
"create database root.sg1",
323323
"count databases",
324324
"count,",
325-
Collections.singleton("1,"));
325+
Collections.singleton("2,"));
326326
}
327327

328328
@Test
@@ -357,7 +357,7 @@ public void testRevokeRoleIdempotent() throws Exception {
357357
"create database root.sg1",
358358
"count databases",
359359
"count,",
360-
Collections.singleton("1,"));
360+
Collections.singleton("2,"));
361361
}
362362

363363
@Test
@@ -393,7 +393,7 @@ public void testDropRoleIdempotent() throws Exception {
393393
"create database root.sg1",
394394
"count databases",
395395
"count,",
396-
Collections.singleton("1,"));
396+
Collections.singleton("2,"));
397397
}
398398

399399
// Table model

0 commit comments

Comments
 (0)