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


##########
integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/enhanced/IoTDBPipeAutoDropIT.java:
##########
@@ -125,30 +126,28 @@ public void testAutoDropInHistoricalTransfer() throws 
Exception {
         "test",
         handleFailure);
 
-    try (final Connection connection =
-            
makeItCloseQuietly(senderEnv.getConnection(BaseEnv.TABLE_SQL_DIALECT));
-        final Statement statement = 
makeItCloseQuietly(connection.createStatement()); ) {
-      ResultSet result = statement.executeQuery("show pipes");
+    try (final SyncConfigNodeIServiceClient client =
+        (SyncConfigNodeIServiceClient) 
senderEnv.getLeaderConfigNodeConnection()) {
+      // Fetch a fresh table-model snapshot on every poll while history pipes 
are being removed.
       await()
           .pollInSameThread()
           .pollDelay(1L, TimeUnit.SECONDS)
           .pollInterval(1L, TimeUnit.SECONDS)
           .atMost(600, TimeUnit.SECONDS)
           .untilAsserted(
               () -> {
-                try {
-                  int pipeNum = 0;
-                  while (result.next()) {
-                    final String pipeName = 
result.getString(ColumnHeaderConstant.ID);
-                    if 
(!pipeName.contains(PipeStaticMeta.CONSENSUS_PIPE_PREFIX)
-                        && pipeName.endsWith("_history")) {
-                      pipeNum++;
-                    }
-                  }
-                  Assert.assertEquals(0, pipeNum);
-                } catch (Exception e) {
-                  Assert.fail();
-                }
+                final List<TShowPipeInfo> showPipeResult =
+                    client.showPipe(
+                            new TShowPipeReq()
+                                .setIsTableModel(true)
+                                .setUserName(SessionConfig.DEFAULT_USER))
+                        .pipeInfoList;

Review Comment:
   Applied in f15d2454293. All four auto-drop polling blocks now retain the 
TShowPipeResp and assert response.getStatus().getCode() is SUCCESS before 
reading pipeInfoList, so an RPC error cannot be treated as successful deletion.



-- 
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