From ed91cd0d2c73f5aa59058b25d6ade1e47adaf5e9 Mon Sep 17 00:00:00 2001 From: yujun Date: Thu, 11 Jun 2026 16:37:03 +0800 Subject: [PATCH] fix test_analyze_mv row_count assertion flaky after truncate The row_count_for_nereids (column 4 of show index stats) can be either -1 (not yet reported by BE) or 0 (reported as 0 rows for empty table) right after truncate table. Asserting exactly -1 creates a race condition with BE tablet reporting, especially on cloud where CloudTabletStatMgr unconditionally sets rowCountReported=true. Change the assertion to accept both -1 and 0. Co-Authored-By: Claude Fable 5 --- regression-test/suites/statistics/test_analyze_mv.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/regression-test/suites/statistics/test_analyze_mv.groovy b/regression-test/suites/statistics/test_analyze_mv.groovy index 67dab8de2ec3bd..fc4949c5632903 100644 --- a/regression-test/suites/statistics/test_analyze_mv.groovy +++ b/regression-test/suites/statistics/test_analyze_mv.groovy @@ -611,7 +611,8 @@ suite("test_analyze_mv") { assertEquals("mvTestDup", result_row[0][0]) assertEquals("mv3", result_row[0][1]) assertEquals("0", result_row[0][3]) - assertEquals("-1", result_row[0][4]) + assertTrue(result_row[0][4] == "-1" || result_row[0][4] == "0", + "Expected row_count to be -1 or 0 after truncate, but got: ${result_row[0][4]}") // ** Embedded test for skip auto analyze when table is empty sql """analyze table mvTestDup properties ("use.auto.analyzer" = "true")"""