Merge pull request #2249 from taosdata/feature/sangshuduo/multi-thread-random-test
fix drop_stable bug.
This commit is contained in:
commit
cae80f403e
|
@ -127,6 +127,8 @@ class Test (Thread):
|
||||||
def drop_stable(self):
|
def drop_stable(self):
|
||||||
tdLog.info("drop_stable")
|
tdLog.info("drop_stable")
|
||||||
global last_stb
|
global last_stb
|
||||||
|
global last_tb
|
||||||
|
global written
|
||||||
|
|
||||||
if (last_stb == ""):
|
if (last_stb == ""):
|
||||||
tdLog.info("no super table")
|
tdLog.info("no super table")
|
||||||
|
@ -135,6 +137,8 @@ class Test (Thread):
|
||||||
tdLog.info("will drop last super table")
|
tdLog.info("will drop last super table")
|
||||||
tdSql.execute('drop table %s' % last_stb)
|
tdSql.execute('drop table %s' % last_stb)
|
||||||
last_stb = ""
|
last_stb = ""
|
||||||
|
last_tb = ""
|
||||||
|
written = 0
|
||||||
|
|
||||||
def restart_database(self):
|
def restart_database(self):
|
||||||
tdLog.info("restart_database")
|
tdLog.info("restart_database")
|
||||||
|
|
|
@ -105,12 +105,18 @@ class Test (threading.Thread):
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
tdLog.info("will create stable %s" % current_stb)
|
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(
|
tdSql.execute(
|
||||||
'create table %s(ts timestamp, c1 int, c2 nchar(10)) tags (t1 int, t2 nchar(10))' %
|
'create table %s(ts timestamp, c1 int, c2 nchar(10)) tags (t1 int, t2 nchar(10))' %
|
||||||
current_stb)
|
current_stb)
|
||||||
last_stb = current_stb
|
last_stb = current_stb
|
||||||
|
|
||||||
current_tb = "tb%d" % int(round(time.time() * 1000))
|
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(
|
tdSql.execute(
|
||||||
"create table %s using %s tags (1, '表1')" %
|
"create table %s using %s tags (1, '表1')" %
|
||||||
(current_tb, last_stb))
|
(current_tb, last_stb))
|
||||||
|
@ -128,6 +134,8 @@ class Test (threading.Thread):
|
||||||
def drop_stable(self):
|
def drop_stable(self):
|
||||||
tdLog.info("drop_stable")
|
tdLog.info("drop_stable")
|
||||||
global last_stb
|
global last_stb
|
||||||
|
global last_tb
|
||||||
|
global written
|
||||||
|
|
||||||
if (last_stb == ""):
|
if (last_stb == ""):
|
||||||
tdLog.info("no super table")
|
tdLog.info("no super table")
|
||||||
|
@ -136,6 +144,8 @@ class Test (threading.Thread):
|
||||||
tdLog.info("will drop last super table")
|
tdLog.info("will drop last super table")
|
||||||
tdSql.execute('drop table %s' % last_stb)
|
tdSql.execute('drop table %s' % last_stb)
|
||||||
last_stb = ""
|
last_stb = ""
|
||||||
|
last_tb = ""
|
||||||
|
written = 0
|
||||||
|
|
||||||
def restart_database(self):
|
def restart_database(self):
|
||||||
tdLog.info("restart_database")
|
tdLog.info("restart_database")
|
||||||
|
|
|
@ -111,6 +111,8 @@ class Test:
|
||||||
tdLog.info("will drop last super table")
|
tdLog.info("will drop last super table")
|
||||||
tdSql.execute('drop table %s' % self.last_stb)
|
tdSql.execute('drop table %s' % self.last_stb)
|
||||||
self.last_stb = ""
|
self.last_stb = ""
|
||||||
|
self.last_tb = ""
|
||||||
|
self.written = 0
|
||||||
|
|
||||||
def query_data_from_stable(self):
|
def query_data_from_stable(self):
|
||||||
tdLog.info("query_data_from_stable")
|
tdLog.info("query_data_from_stable")
|
||||||
|
|
Loading…
Reference in New Issue