From cae413f023e26a1332d0913f4efb8dbda7b54fc7 Mon Sep 17 00:00:00 2001 From: shuke987 Date: Mon, 15 Jun 2026 14:52:58 +0800 Subject: [PATCH] [fix](case) test_admin_compact_table: count distinct tablets for multi-replica clusters SHOW TABLETS returns one row per (tablet, replica). On a multi-replica test cluster (e.g. force_olap_table_replication_num=3) a table with BUCKETS 1 yields 3 rows, so assertEquals(1, tablets.size()) fails (expected 1, got 3) -- the assertion implicitly assumes a single replica. Assert on the distinct tablet count instead. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../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 2d6670c4123a9a..a392337ed7fc27 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