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

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


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new 0ce3f448c92 [fix](case) test_admin_compact_table: count distinct 
tablets for multi-replica clusters (#64509)
0ce3f448c92 is described below

commit 0ce3f448c92c5e33b463f26960791348645b7060
Author: shuke <[email protected]>
AuthorDate: Tue Jun 16 14:58:31 2026 +0800

    [fix](case) test_admin_compact_table: count distinct tablets for 
multi-replica clusters (#64509)
    
    ## Problem
    On a multi-replica test cluster (e.g.
    `force_olap_table_replication_num=3`), `SHOW TABLETS` returns one row
    per (tablet, replica). A table created with `BUCKETS 1` therefore yields
    3 rows, so `assertEquals(1, tablets.size())` fails (expected 1, got 3).
    The assertion implicitly assumes a single replica.
    
    ## Fix
    Assert on the distinct tablet count: `tablets.collect { it.TabletId
    }.unique().size()`. The subsequent code already picks one replica via
    `tablets[0]`.
    
    ## Verification
    Ran the suite on a branch-4.1 local cluster (3 FE + 4 BE, force-3
    replicas) — passes.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
---
 regression-test/suites/compaction/test_admin_compact_table.groovy | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/regression-test/suites/compaction/test_admin_compact_table.groovy 
b/regression-test/suites/compaction/test_admin_compact_table.groovy
index 2d6670c4123..a392337ed7f 100644
--- a/regression-test/suites/compaction/test_admin_compact_table.groovy
+++ b/regression-test/suites/compaction/test_admin_compact_table.groovy
@@ -45,7 +45,10 @@ suite("test_admin_compact_table", "p0") {
     """
 
     def tablets = sql_return_maparray "SHOW TABLETS FROM ${tableName}"
-    assertEquals(1, tablets.size())
+    // SHOW TABLETS returns one row per (tablet, replica); on a multi-replica
+    // cluster (e.g. force_olap_table_replication_num=3) BUCKETS 1 yields 3 
rows.
+    // Assert on the distinct tablet count, then pick any replica below.
+    assertEquals(1, tablets.collect { it.TabletId }.unique().size())
     def tabletId = tablets[0].TabletId
     def backendId = tablets[0].BackendId
 


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

Reply via email to