fix: test test_stb_keep_compact.py failed. (#30223)

This commit is contained in:
Zhixiao Bao 2025-03-18 10:15:48 +08:00 committed by GitHub
parent 930b57b770
commit 394f64a5a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 3 deletions

View File

@ -170,11 +170,18 @@ class TDTestCase(TBase):
tdLog.info(f"Triggering compaction for database {db_name}...")
tdLog.info(f"FLUSH DATABASE {db_name}")
tdSql.execute(f"FLUSH DATABASE {db_name}")
time.sleep(10)
time.sleep(5)
# Correct syntax includes database name
tdSql.execute(f"COMPACT DATABASE {db_name}")
# Give system enough time to complete compaction
time.sleep(10)
# Wait for compaction to complete by checking status
while True:
tdSql.query(f"SHOW COMPACTS")
if tdSql.queryRows == 0:
break
time.sleep(1)
tdLog.info(f"Compaction operation for {db_name} completed")
def test_case1_stb_keep_2_db_keep_10(self):