Caideyipi commented on code in PR #14706:
URL: https://github.com/apache/iotdb/pull/14706#discussion_r1918233774


##########
integration-test/src/test/java/org/apache/iotdb/pipe/it/tablemodel/IoTDBPipeClusterIT.java:
##########
@@ -90,6 +91,60 @@ public void setUp() {
     receiverEnv.initClusterEnvironment(3, 3, 180);
   }
 
+  @Test
+  public void testMachineDowntime() {
+    StringBuilder a = new StringBuilder();
+    for (DataNodeWrapper nodeWrapper : receiverEnv.getDataNodeWrapperList()) {
+      a.append(nodeWrapper.getIp()).append(":").append(nodeWrapper.getPort());
+      a.append(",");
+    }
+    a.deleteCharAt(a.length() - 1);
+
+    TableModelUtils.createDataBaseAndTable(senderEnv, "test", "test");
+    TableModelUtils.insertData("test", "test", 0, 1, senderEnv);
+    try (final SyncConfigNodeIServiceClient client =
+        (SyncConfigNodeIServiceClient) 
senderEnv.getLeaderConfigNodeConnection()) {
+
+      final Map<String, String> extractorAttributes = new HashMap<>();
+      final Map<String, String> processorAttributes = new HashMap<>();
+      final Map<String, String> connectorAttributes = new HashMap<>();
+
+      extractorAttributes.put("extractor", "iotdb-extractor");
+      extractorAttributes.put("capture.table", "true");
+
+      processorAttributes.put("processor", "do-nothing-processor");
+
+      connectorAttributes.put("connector", "iotdb-thrift-connector");
+      connectorAttributes.put("connector.batch.enable", "false");
+      connectorAttributes.put("connector.node-urls", a.toString());
+
+      final TSStatus status =
+          client.createPipe(
+              new TCreatePipeReq("p1", connectorAttributes)
+                  .setExtractorAttributes(extractorAttributes)
+                  .setProcessorAttributes(processorAttributes));
+
+      Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), 
status.getCode());
+
+      // The purpose of sleeping here is to ensure that the receiving end has 
created the database
+      // and created the table.
+      Thread.sleep(10000);

Review Comment:
   Use TestUtils.assertxxxxeventuallyOnEnv to do this



##########
integration-test/src/test/java/org/apache/iotdb/pipe/it/tablemodel/IoTDBPipeClusterIT.java:
##########
@@ -78,6 +78,7 @@ public void setUp() {
         .getConfig()
         .getCommonConfig()
         .setAutoCreateSchemaEnabled(true)
+        .setDataReplicationFactor(3)

Review Comment:
   This is 2 in major scenarios



##########
integration-test/src/main/java/org/apache/iotdb/it/env/cluster/env/AbstractEnv.java:
##########
@@ -627,6 +639,17 @@ protected NodeConnection getWriteConnection(
         this.dataNodeWrapperList, version, username, password, sqlDialect);
   }
 
+  protected NodeConnection getWriteConnection(

Review Comment:
   Why not use "getWriteConnectionWithSpecifiedDataNode"....



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to