Merge pull request #6839 from taosdata/dev/chr
[TD-5087]<test>: update testcase that compressing wal logs
This commit is contained in:
commit
27618bdfe9
|
@ -236,7 +236,7 @@ python3 ./test.py -f query/queryTscomputWithNow.py
|
|||
python3 ./test.py -f query/computeErrorinWhere.py
|
||||
python3 ./test.py -f query/queryTsisNull.py
|
||||
python3 ./test.py -f query/subqueryFilter.py
|
||||
# python3 ./test.py -f query/nestedQuery/queryInterval.py
|
||||
python3 ./test.py -f query/nestedQuery/queryInterval.py
|
||||
python3 ./test.py -f query/queryStateWindow.py
|
||||
python3 ./test.py -f query/nestedQuery/queryWithOrderLimit.py
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ class TDTestCase:
|
|||
self.rowNum = 100
|
||||
self.ts = 1537146000000
|
||||
self.ts1 = 1537146000000000
|
||||
self.ts2 = 1597146000000
|
||||
|
||||
|
||||
def run(self):
|
||||
|
@ -35,6 +36,8 @@ class TDTestCase:
|
|||
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
|
||||
col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20), tag1 int)''')
|
||||
tdSql.execute("create table test1 using test tags('beijing', 10)")
|
||||
tdSql.execute("create table test2 using test tags('tianjing', 20)")
|
||||
tdSql.execute("create table test3 using test tags('shanghai', 20)")
|
||||
tdSql.execute("create table gtest1 (ts timestamp, col1 float)")
|
||||
tdSql.execute("create table gtest2 (ts timestamp, col1 tinyint)")
|
||||
tdSql.execute("create table gtest3 (ts timestamp, col1 tinyint)")
|
||||
|
@ -48,6 +51,10 @@ class TDTestCase:
|
|||
for i in range(self.rowNum):
|
||||
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
|
||||
% (self.ts + i*1000, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
|
||||
tdSql.execute("insert into test2 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
|
||||
% (self.ts2 + i*1000, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
|
||||
tdSql.execute("insert into test3 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
|
||||
% (self.ts2 + i*1000, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
|
||||
|
||||
tdSql.execute("insert into gtest1 values(1537146000000,0);")
|
||||
tdSql.execute("insert into gtest1 values(1537146001100,1.2);")
|
||||
|
@ -69,7 +76,7 @@ class TDTestCase:
|
|||
tdSql.execute("insert into gtest8 values(1537146000002,4);")
|
||||
tdSql.execute("insert into gtest8 values(1537146002202,4);")
|
||||
|
||||
# irate verifacation
|
||||
# irate verifacation --child table'query
|
||||
tdSql.query("select irate(col1) from test1;")
|
||||
tdSql.checkData(0, 0, 1)
|
||||
tdSql.query("select irate(col1) from test1 interval(10s);")
|
||||
|
@ -99,6 +106,32 @@ class TDTestCase:
|
|||
tdSql.query("select irate(col2) from test1;")
|
||||
tdSql.checkData(0, 0, 1)
|
||||
|
||||
# irate verifacation --super table'query
|
||||
tdSql.query("select irate(col1) from test group by tbname,loc,tag1;")
|
||||
tdSql.checkData(0, 0, 1)
|
||||
tdSql.checkData(1, 1, "test2")
|
||||
tdSql.checkData(2, 2, "shanghai")
|
||||
|
||||
# add function testcase of twa: query from super table
|
||||
tdSql.query("select twa(col1) from test group by tbname,loc,tag1;")
|
||||
tdSql.checkData(0, 0, 50.5)
|
||||
tdSql.checkData(1, 1, "test2")
|
||||
tdSql.checkData(2, 2, "shanghai")
|
||||
|
||||
# error: function of irate and twa has invalid operation
|
||||
tdSql.error("select irate(col7) from test group by tbname,loc,tag1;")
|
||||
tdSql.error("select irate(col7) from test group by tbname;")
|
||||
tdSql.error("select irate(col1) from test group by loc,tbname,tag1;")
|
||||
# tdSql.error("select irate(col1) from test group by tbname,col7;")
|
||||
tdSql.error("select irate(col1) from test group by col7,tbname;")
|
||||
tdSql.error("select twa(col7) from test group by tbname,loc,tag1;")
|
||||
tdSql.error("select twa(col7) from test group by tbname;")
|
||||
tdSql.error("select twa(col1) from test group by loc,tbname,tag1;")
|
||||
# tdSql.error("select twa(col1) from test group by tbname,col7;")
|
||||
tdSql.error("select twa(col1) from test group by col7,tbname;")
|
||||
|
||||
|
||||
# general table'query
|
||||
tdSql.query("select irate(col1) from gtest1;")
|
||||
tdSql.checkData(0, 0, 1.2/1.1)
|
||||
tdSql.query("select irate(col1) from gtest2;")
|
||||
|
|
|
@ -28,6 +28,7 @@ class TDTestCase:
|
|||
tdSql.init(conn.cursor(), logSql)
|
||||
|
||||
def getBuildPath(self):
|
||||
global selfPath
|
||||
selfPath = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
if ("community" in selfPath):
|
||||
|
@ -53,7 +54,7 @@ class TDTestCase:
|
|||
tdLog.info("taosd found in %s" % buildPath)
|
||||
|
||||
binPath = buildPath+ "/build/bin/"
|
||||
testPath = buildPath[:buildPath.find("debug")]
|
||||
testPath = selfPath+ "/../../../"
|
||||
walFilePath = testPath + "/sim/dnode1/data/mnode_bak/wal/"
|
||||
|
||||
#new db and insert data
|
||||
|
|
|
@ -86,6 +86,18 @@ class TwoClients:
|
|||
tdSql.execute("alter table stb2_0 add column col2 binary(4)")
|
||||
tdSql.execute("alter table stb2_0 drop column col1")
|
||||
tdSql.execute("insert into stb2_0 values(1614218422000,8638,'R')")
|
||||
tdSql.execute("drop dnode 10")
|
||||
sleep(10)
|
||||
os.system("rm -rf /var/lib/taos/*")
|
||||
print("clear dnode chenhaoran02'data files")
|
||||
os.system("nohup /usr/bin/taosd > /dev/null 2>&1 &")
|
||||
print("start taosd")
|
||||
sleep(10)
|
||||
tdSql.execute("reset query cache ;")
|
||||
tdSql.execute("create dnode chenhaoran02 ;")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# stop taosd and compact wal file
|
||||
|
|
Loading…
Reference in New Issue