diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeAutoSplitIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeAutoSplitIT.java index 048f9a191801..4b9012b88ab3 100644 --- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeAutoSplitIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeAutoSplitIT.java @@ -125,15 +125,26 @@ public void testSingleEnv() throws Exception { final List showPipeResult = client.showPipe(new TShowPipeReq().setUserName(SessionConfig.DEFAULT_USER)).pipeInfoList; showPipeResult.removeIf(i -> i.getId().startsWith("__consensus")); - Assert.assertEquals(3, showPipeResult.size()); + // a2b2 is a finite history-only pipe and may have already been auto-dropped when there is no + // historical data to transfer. The other two pipes must remain and none of the pipes should + // be split because they are not full-sync pipes. + Assert.assertTrue(showPipeResult.stream().anyMatch(i -> Objects.equals(i.id, "a2b1"))); + Assert.assertTrue(showPipeResult.stream().anyMatch(i -> Objects.equals(i.id, "a2b3"))); + Assert.assertTrue( + showPipeResult.stream() + .allMatch( + i -> + Objects.equals(i.id, "a2b1") + || Objects.equals(i.id, "a2b2") + || Objects.equals(i.id, "a2b3"))); } TestUtils.executeNonQueries( senderEnv, Arrays.asList( - "drop pipe a2b1", - "drop pipe a2b2", - "drop pipe a2b3", + "drop pipe if exists a2b1", + "drop pipe if exists a2b2", + "drop pipe if exists a2b3", "insert into root.test.device(time, field) values(0,1),(1,2)", "delete from root.test.device.* where time == 0", String.format( diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoDropIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoDropIT.java index 2d1d7d51f336..fa6694e3be7a 100644 --- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoDropIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/enhanced/IoTDBPipeAutoDropIT.java @@ -65,6 +65,12 @@ public void setUp() { super.setUp(); } + @Override + protected void setupConfig() { + super.setupConfig(); + senderEnv.getConfig().getConfigNodeConfig().setLeaderDistributionPolicy("HASH"); + } + @Test public void testAutoDropInHistoricalTransfer() throws Exception { final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);