This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 0e4002d9db72106fc2506e39c8cfa99d0f14d292
Author: lihangyu <[email protected]>
AuthorDate: Wed Feb 7 10:18:31 2024 +0800

    [chore](regression-test) fix legacy use of get tablet info (#30931)
---
 .../variant_p0/compaction_sparse_column.groovy      | 21 ++++++++++-----------
 .../variant_p0/test_compaction_extract_root.groovy  | 21 ++++++++++-----------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/regression-test/suites/variant_p0/compaction_sparse_column.groovy 
b/regression-test/suites/variant_p0/compaction_sparse_column.groovy
index 6a26c043e22..366b5e9eae9 100644
--- a/regression-test/suites/variant_p0/compaction_sparse_column.groovy
+++ b/regression-test/suites/variant_p0/compaction_sparse_column.groovy
@@ -103,12 +103,12 @@ suite("test_compaction_sparse_column", "nonConcurrent") {
         qt_select_all_bfcompact """SELECT * from ${tableName} where 
(cast(v['point'] as int) = 1);"""
 
         
//TabletId,ReplicaId,BackendId,SchemaHash,Version,LstSuccessVersion,LstFailedVersion,LstFailedTime,LocalDataSize,RemoteDataSize,RowCount,State,LstConsistencyCheckTime,CheckVersion,VersionCount,PathHash,MetaUrl,CompactionStatus
-        String[][] tablets = sql """ show tablets from ${tableName}; """
+        def tablets = sql_return_maparray """ show tablets from ${tableName}; 
"""
 
         // trigger compactions for all tablets in ${tableName}
-        for (String[] tablet in tablets) {
-            String tablet_id = tablet[0]
-            backend_id = tablet[2]
+        for (def tablet in tablets) {
+            String tablet_id = tablet.TabletId
+            backend_id = tablet.BackendId
             (code, out, err) = 
be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), 
backendId_to_backendHttpPort.get(backend_id), tablet_id)
             logger.info("Run compaction: code=" + code + ", out=" + out + ", 
err=" + err)
             assertEquals(code, 0)
@@ -123,12 +123,12 @@ suite("test_compaction_sparse_column", "nonConcurrent") {
         }
 
         // wait for all compactions done
-        for (String[] tablet in tablets) {
+        for (def tablet in tablets) {
             boolean running = true
             do {
                 Thread.sleep(1000)
-                String tablet_id = tablet[0]
-                backend_id = tablet[2]
+                String tablet_id = tablet.TabletId
+                backend_id = tablet.BackendId
                 (code, out, err) = 
be_get_compaction_status(backendId_to_backendIP.get(backend_id), 
backendId_to_backendHttpPort.get(backend_id), tablet_id)
                 logger.info("Get compaction status: code=" + code + ", out=" + 
out + ", err=" + err)
                 assertEquals(code, 0)
@@ -139,10 +139,9 @@ suite("test_compaction_sparse_column", "nonConcurrent") {
         }
 
         int rowCount = 0
-        for (String[] tablet in tablets) {
-            String tablet_id = tablet[0]
-            def compactionStatusUrlIndex = 18
-            (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex])
+        for (def tablet in tablets) {
+            String tablet_id = tablet.TabletId
+            (code, out, err) = curl("GET", tablet.CompactionStatus)
             logger.info("Show tablets status: code=" + code + ", out=" + out + 
", err=" + err)
             assertEquals(code, 0)
             def tabletJson = parseJson(out.trim())
diff --git 
a/regression-test/suites/variant_p0/test_compaction_extract_root.groovy 
b/regression-test/suites/variant_p0/test_compaction_extract_root.groovy
index f3d6da37557..78016e25602 100644
--- a/regression-test/suites/variant_p0/test_compaction_extract_root.groovy
+++ b/regression-test/suites/variant_p0/test_compaction_extract_root.groovy
@@ -96,12 +96,12 @@ suite("test_compaction_extract_root", "nonConcurrent") {
     qt_select_1_bfcompact """select v['b'] from test_t where k = 0 and 
cast(v['a'] as int) = 11245;"""
 
     
//TabletId,ReplicaId,BackendId,SchemaHash,Version,LstSuccessVersion,LstFailedVersion,LstFailedTime,LocalDataSize,RemoteDataSize,RowCount,State,LstConsistencyCheckTime,CheckVersion,VersionCount,PathHash,MetaUrl,CompactionStatus
-    String[][] tablets = sql """ show tablets from ${tableName}; """
+    def tablets = sql_return_maparray """ show tablets from ${tableName}; """
 
     // trigger compactions for all tablets in ${tableName}
-    for (String[] tablet in tablets) {
-        String tablet_id = tablet[0]
-        backend_id = tablet[2]
+    for (def tablet in tablets) {
+        String tablet_id = tablet.TabletId
+        backend_id = tablet.BackendId 
         (code, out, err) = 
be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), 
backendId_to_backendHttpPort.get(backend_id), tablet_id)
         logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" 
+ err)
         assertEquals(code, 0)
@@ -116,12 +116,12 @@ suite("test_compaction_extract_root", "nonConcurrent") {
     }
 
     // wait for all compactions done
-    for (String[] tablet in tablets) {
+    for (def tablet in tablets) {
         boolean running = true
         do {
             Thread.sleep(1000)
-            String tablet_id = tablet[0]
-            backend_id = tablet[2]
+            String tablet_id = tablet.TabletId
+            backend_id = tablet.BackendId 
             (code, out, err) = 
be_get_compaction_status(backendId_to_backendIP.get(backend_id), 
backendId_to_backendHttpPort.get(backend_id), tablet_id)
             logger.info("Get compaction status: code=" + code + ", out=" + out 
+ ", err=" + err)
             assertEquals(code, 0)
@@ -132,10 +132,9 @@ suite("test_compaction_extract_root", "nonConcurrent") {
     }
 
     int rowCount = 0
-    for (String[] tablet in tablets) {
-        String tablet_id = tablet[0]
-        def compactionStatusUrlIndex = 18
-        (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex])
+    for (def tablet in tablets) {
+        String tablet_id = tablet.TabletId
+        (code, out, err) = curl("GET", tablet.CompactionStatus)
         logger.info("Show tablets status: code=" + code + ", out=" + out + ", 
err=" + err)
         assertEquals(code, 0)
         def tabletJson = parseJson(out.trim())


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to