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


##########
integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java:
##########
@@ -2029,7 +2104,8 @@ public static void assertDataAlwaysOnEnv(
                 } catch (Exception e) {
                   Assert.fail();
                 }
-              });
+              })
+          .until(() -> true);

Review Comment:
   [P1] Fix the remaining lifecycle expectations when enabling continuous 
assertions
   
   This terminal await also activates the previously dormant checks in 
`IoTDBPipeLifeCycleIT.testLifeCycleWithHistoryDisabled`, but that caller has 
not been updated. After `stopPipe("p1")`, `root.ln0` is created only on the 
sender, while the receiver retains the two existing series under `root.db`. The 
receiver's series count under `root.ln0`, series count under `root.db`, and 
database count for `root.ln0` should therefore be `0`, `2`, and `0`; the 
assertions at lines 227–238 still expect `1` for all three.
   
   I reproduced the failure from a clean reactor build with `MultiClusterIT` 
and two 1-ConfigNode/3-DataNode clusters: the first incorrect assertion fails 
at `IoTDBPipeLifeCycleIT.java:227`, with actual `0` versus expected `1`. Please 
update all three expectations together with this helper change so the existing 
tree-model pipe test remains runnable.



##########
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:
   [P2] Check the ShowPipe response status before accepting an empty list
   
   The direct RPC does not translate a non-success `TSStatus` into an exception 
as the JDBC query did. In `PipeTaskCoordinator.showPipes()`, the 
`ConsensusException` handler returns `EXECUTE_STATEMENT_ERROR` together with an 
empty `pipeInfoList`. Reading only the list makes both `noneMatch(...)` and 
`isEmpty()` accept that failed read as successful pipe deletion, even though 
deletion has not been established.
   
   I verified this using the production error-response conversion: a response 
with status `301` passes both removal predicates. Please assert that the 
response status is `TSStatusCode.SUCCESS_STATUS` before examining the list, in 
all four new polling blocks across the table-model and tree-model auto-drop 
tests.



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