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 db85ce2fe058837ecfe12599ddbba418d35e473d..cab17c4c1a91a25db57a88d674b7b60accd55a34 100644 --- a/tests/pytest/random-test/random-test-multi-threading-3.py +++ b/tests/pytest/random-test/random-test-multi-threading-3.py @@ -205,7 +205,7 @@ class Test (Thread): global written dnodesDir = tdDnodes.getDnodesRootDir() - dataDir = dnodesDir + '/dnode1/*' + dataDir = dnodesDir + '/dnode1/data/*' deleteCmd = 'rm -rf %s' % dataDir os.system(deleteCmd) diff --git a/tests/pytest/random-test/random-test-multi-threading.py b/tests/pytest/random-test/random-test-multi-threading.py index 7d1a8a155dac8b427ec184b544632c747a6eca6a..1d8a5c3c82f98ffeb5817186b78959a2e160b302 100644 --- a/tests/pytest/random-test/random-test-multi-threading.py +++ b/tests/pytest/random-test/random-test-multi-threading.py @@ -208,7 +208,7 @@ class Test (threading.Thread): global written dnodesDir = tdDnodes.getDnodesRootDir() - dataDir = dnodesDir + '/dnode1/*' + dataDir = dnodesDir + '/dnode1/data/*' deleteCmd = 'rm -rf %s' % dataDir os.system(deleteCmd) diff --git a/tests/pytest/stream/stream1.py b/tests/pytest/stream/stream1.py index 7a9d88da3b2aa7bedae0824cac89349dcbeb5040..3b88b4f9f38fa7fb7183b5f29d2f1a65727f8064 100644 --- a/tests/pytest/stream/stream1.py +++ b/tests/pytest/stream/stream1.py @@ -31,21 +31,26 @@ class TDTestCase: tdSql.prepare() tdLog.info("===== step1 =====") - tdSql.execute("create table stb0(ts timestamp, col1 int, col2 float) tags(tgcol int)") + tdSql.execute( + "create table stb0(ts timestamp, col1 int, col2 float) tags(tgcol int)") for i in range(tbNum): tdSql.execute("create table tb%d using stb0 tags(%d)" % (i, i)) for j in range(rowNum): - tdSql.execute("insert into tb%d values (now - %dm, %d, %d)" % (i, 1440 - j, j, j)) + tdSql.execute( + "insert into tb%d values (now - %dm, %d, %d)" % + (i, 1440 - j, j, j)) time.sleep(0.1) tdLog.info("===== step2 =====") - tdSql.query("select count(*), count(col1), count(col2) from tb0 interval(1d)") + tdSql.query( + "select count(*), count(col1), count(col2) from tb0 interval(1d)") tdSql.checkData(0, 1, rowNum) tdSql.checkData(0, 2, rowNum) tdSql.checkData(0, 3, rowNum) tdSql.query("show tables") tdSql.checkRows(tbNum) - tdSql.execute("create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)") + tdSql.execute( + "create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)") tdSql.query("show tables") tdSql.checkRows(tbNum + 1) @@ -67,7 +72,8 @@ class TDTestCase: tdLog.info("===== step6 =====") time.sleep(0.1) - tdSql.execute("create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)") + tdSql.execute( + "create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)") tdSql.query("show tables") tdSql.checkRows(tbNum + 1) @@ -81,14 +87,16 @@ class TDTestCase: tdSql.checkData(0, 3, rowNum) tdLog.info("===== step8 =====") - tdSql.query("select count(*), count(col1), count(col2) from stb0 interval(1d)") + tdSql.query( + "select count(*), count(col1), count(col2) from stb0 interval(1d)") tdSql.checkData(0, 1, rowNum * tbNum) tdSql.checkData(0, 2, rowNum * tbNum) tdSql.checkData(0, 3, rowNum * tbNum) tdSql.query("show tables") tdSql.checkRows(tbNum + 1) - tdSql.execute("create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)") + tdSql.execute( + "create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)") tdSql.query("show tables") tdSql.checkRows(tbNum + 2) @@ -110,7 +118,8 @@ class TDTestCase: tdSql.error("select * from s1") tdLog.info("===== step12 =====") - tdSql.execute("create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)") + tdSql.execute( + "create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)") tdSql.query("show tables") tdSql.checkRows(tbNum + 2) diff --git a/tests/pytest/stream/stream2.py b/tests/pytest/stream/stream2.py index 96eff3131d5bec3eb7e16f7d002aae25da560bf2..7b77dc7793a280d118229ef128fe833ab932e757 100644 --- a/tests/pytest/stream/stream2.py +++ b/tests/pytest/stream/stream2.py @@ -24,7 +24,6 @@ class TDTestCase: tdLog.debug("start to execute %s" % __file__) tdSql.init(conn.cursor(), logSql) - def run(self): tbNum = 10 rowNum = 20 @@ -33,11 +32,14 @@ class TDTestCase: tdSql.prepare() tdLog.info("===== step1 =====") - tdSql.execute("create table stb0(ts timestamp, col1 int, col2 float) tags(tgcol int)") + tdSql.execute( + "create table stb0(ts timestamp, col1 int, col2 float) tags(tgcol int)") for i in range(tbNum): tdSql.execute("create table tb%d using stb0 tags(%d)" % (i, i)) for j in range(rowNum): - tdSql.execute("insert into tb%d values (now - %dm, %d, %d)" % (i, 1440 - j, j, j)) + tdSql.execute( + "insert into tb%d values (now - %dm, %d, %d)" % + (i, 1440 - j, j, j)) time.sleep(0.1) tdLog.info("===== step2 =====") @@ -45,7 +47,8 @@ class TDTestCase: tdSql.checkData(0, 1, rowNum) tdSql.query("show tables") tdSql.checkRows(tbNum) - tdSql.execute("create table s0 as select count(col1) from tb0 interval(1d)") + tdSql.execute( + "create table s0 as select count(col1) from tb0 interval(1d)") tdSql.query("show tables") tdSql.checkRows(tbNum + 1) @@ -63,7 +66,8 @@ class TDTestCase: tdSql.error("select * from s0") tdLog.info("===== step6 =====") - tdSql.execute("create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)") + tdSql.execute( + "create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)") tdSql.query("show tables") tdSql.checkRows(tbNum + 1) @@ -75,13 +79,15 @@ class TDTestCase: tdSql.checkData(0, 3, rowNum) tdLog.info("===== step8 =====") - tdSql.query("select count(*), count(col1), count(col2) from stb0 interval(1d)") + tdSql.query( + "select count(*), count(col1), count(col2) from stb0 interval(1d)") tdSql.checkData(0, 1, totalNum) tdSql.checkData(0, 2, totalNum) tdSql.checkData(0, 3, totalNum) tdSql.query("show tables") tdSql.checkRows(tbNum + 1) - tdSql.execute("create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)") + tdSql.execute( + "create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)") tdSql.query("show tables") tdSql.checkRows(tbNum + 2) @@ -101,7 +107,8 @@ class TDTestCase: tdSql.error("select * from s1") tdLog.info("===== step12 =====") - tdSql.execute("create table s1 as select count(col1) from stb0 interval(1d)") + tdSql.execute( + "create table s1 as select count(col1) from stb0 interval(1d)") tdSql.query("show tables") tdSql.checkRows(tbNum + 2) @@ -112,7 +119,6 @@ class TDTestCase: #tdSql.checkData(0, 2, None) #tdSql.checkData(0, 3, None) - def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__)