From 26966cd82c3e90438ff30007bbb111ee90197679 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 11 Jun 2020 18:25:58 +0800 Subject: [PATCH] fix drop_stable bug. --- .../random-test/random-test-multi-threading-3.py | 4 ++++ .../pytest/random-test/random-test-multi-threading.py | 10 ++++++++++ tests/pytest/random-test/random-test.py | 2 ++ 3 files changed, 16 insertions(+) diff --git a/tests/pytest/random-test/random-test-multi-threading-3.py b/tests/pytest/random-test/random-test-multi-threading-3.py index 91f35ea7a5..47c4228a8f 100644 --- a/tests/pytest/random-test/random-test-multi-threading-3.py +++ b/tests/pytest/random-test/random-test-multi-threading-3.py @@ -127,6 +127,8 @@ class Test (Thread): def drop_stable(self): tdLog.info("drop_stable") global last_stb + global last_tb + global written if (last_stb == ""): tdLog.info("no super table") @@ -135,6 +137,8 @@ class Test (Thread): tdLog.info("will drop last super table") tdSql.execute('drop table %s' % last_stb) last_stb = "" + last_tb = "" + written = 0 def restart_database(self): tdLog.info("restart_database") diff --git a/tests/pytest/random-test/random-test-multi-threading.py b/tests/pytest/random-test/random-test-multi-threading.py index 997001157e..65b6dcd948 100644 --- a/tests/pytest/random-test/random-test-multi-threading.py +++ b/tests/pytest/random-test/random-test-multi-threading.py @@ -105,12 +105,18 @@ class Test (threading.Thread): return else: tdLog.info("will create stable %s" % current_stb) + tdLog.info( + 'create table %s(ts timestamp, c1 int, c2 nchar(10)) tags (t1 int, t2 nchar(10))' % + current_stb) tdSql.execute( 'create table %s(ts timestamp, c1 int, c2 nchar(10)) tags (t1 int, t2 nchar(10))' % current_stb) last_stb = current_stb current_tb = "tb%d" % int(round(time.time() * 1000)) + tdLog.info( + "create table %s using %s tags (1, '表1')" % + (current_tb, last_stb)) tdSql.execute( "create table %s using %s tags (1, '表1')" % (current_tb, last_stb)) @@ -128,6 +134,8 @@ class Test (threading.Thread): def drop_stable(self): tdLog.info("drop_stable") global last_stb + global last_tb + global written if (last_stb == ""): tdLog.info("no super table") @@ -136,6 +144,8 @@ class Test (threading.Thread): tdLog.info("will drop last super table") tdSql.execute('drop table %s' % last_stb) last_stb = "" + last_tb = "" + written = 0 def restart_database(self): tdLog.info("restart_database") diff --git a/tests/pytest/random-test/random-test.py b/tests/pytest/random-test/random-test.py index 9cfc24f404..5eb356960a 100644 --- a/tests/pytest/random-test/random-test.py +++ b/tests/pytest/random-test/random-test.py @@ -111,6 +111,8 @@ class Test: tdLog.info("will drop last super table") tdSql.execute('drop table %s' % self.last_stb) self.last_stb = "" + self.last_tb = "" + self.written = 0 def query_data_from_stable(self): tdLog.info("query_data_from_stable") -- GitLab