From 0f78a600cbc77054ae4563020150cbdc8afc2c14 Mon Sep 17 00:00:00 2001 From: jiacy-jcy <714897623@qq.com> Date: Fri, 16 Sep 2022 10:22:11 +0800 Subject: [PATCH] test:add test case for param ttl --- tests/system-test/1-insert/table_param_ttl.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/system-test/1-insert/table_param_ttl.py b/tests/system-test/1-insert/table_param_ttl.py index 5ef6548789..f5fc2d627b 100644 --- a/tests/system-test/1-insert/table_param_ttl.py +++ b/tests/system-test/1-insert/table_param_ttl.py @@ -67,9 +67,21 @@ class TDTestCase: tdSql.checkRows(self.tbnum - int(self.tbnum/2)) tdSql.execute('drop database db') + def ttl_check_insert(self): + tdSql.prepare() + tdSql.execute(f'create table {self.stbname} (ts timestamp,c0 int) tags(t0 int)') + for i in range(self.tbnum): + tdSql.execute(f'insert into {self.stbname}_{i} using {self.stbname} tags({i}) ttl {self.ttl_param} values(now,1)') + tdSql.query(f'show tables') + tdSql.checkRows(self.tbnum) + sleep(self.updatecfgDict['ttlUnit']*self.ttl_param+self.updatecfgDict['ttlPushInterval']) + tdSql.query(f'show tables') + tdSql.checkRows(0) + tdSql.execute('drop database db') def run(self): self.ttl_check_ntb() self.ttl_check_ctb() + self.ttl_check_insert() def stop(self): tdSql.close() -- GitLab