[TD-5369]<test> change the nums of tables and insert rows!

This commit is contained in:
wenzhouwww 2021-07-27 11:06:04 +08:00
parent c63d6f4c94
commit 74fa1114f3
7 changed files with 38 additions and 40 deletions

View File

@ -35,13 +35,13 @@
"super_tables": [{ "super_tables": [{
"name": "stb0", "name": "stb0",
"child_table_exists":"no", "child_table_exists":"no",
"childtable_count": 1000, "childtable_count": 100,
"childtable_prefix": "tb0_", "childtable_prefix": "tb0_",
"auto_create_table": "no", "auto_create_table": "no",
"batch_create_tbl_num": 20, "batch_create_tbl_num": 20,
"data_source": "rand", "data_source": "rand",
"insert_mode": "taosc", "insert_mode": "taosc",
"insert_rows": 10000, "insert_rows": 100,
"childtable_offset":0, "childtable_offset":0,
"multi_thread_write_one_tbl": "no", "multi_thread_write_one_tbl": "no",
"insert_interval":0, "insert_interval":0,
@ -61,13 +61,13 @@
{ {
"name": "stb1", "name": "stb1",
"child_table_exists":"no", "child_table_exists":"no",
"childtable_count": 1000, "childtable_count": 100,
"childtable_prefix": "tb1_", "childtable_prefix": "tb1_",
"auto_create_table": "no", "auto_create_table": "no",
"batch_create_tbl_num": 20, "batch_create_tbl_num": 20,
"data_source": "rand", "data_source": "rand",
"insert_mode": "taosc", "insert_mode": "taosc",
"insert_rows": 10000, "insert_rows": 100,
"childtable_offset":0, "childtable_offset":0,
"multi_thread_write_one_tbl": "no", "multi_thread_write_one_tbl": "no",
"insert_interval":0, "insert_interval":0,

View File

@ -35,7 +35,7 @@
"super_tables": [{ "super_tables": [{
"name": "stb0", "name": "stb0",
"child_table_exists":"no", "child_table_exists":"no",
"childtable_count": 1000, "childtable_count": 100,
"childtable_prefix": "tb0_", "childtable_prefix": "tb0_",
"auto_create_table": "no", "auto_create_table": "no",
"batch_create_tbl_num": 20, "batch_create_tbl_num": 20,

View File

@ -56,46 +56,47 @@ class TDTestCase:
os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoTestNanoDatabase.json -y " % binPath) os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoTestNanoDatabase.json -y " % binPath)
tdSql.execute("use nsdb") tdSql.execute("use nsdb")
tdSql.query("show stables") tdSql.query("show stables")
tdSql.checkData(0, 4, 1000) tdSql.checkData(0, 4, 100)
tdSql.query("select count (tbname) from stb0") tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 1000) tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from tb0_0") tdSql.query("select count(*) from tb0_0")
tdSql.checkData(0, 0, 10000) tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from stb0") tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 10000000) tdSql.checkData(0, 0, 10000)
tdSql.query("describe stb0") tdSql.query("describe stb0")
tdSql.checkDataType(9, 1,"TIMESTAMP") tdSql.checkDataType(9, 1,"TIMESTAMP")
tdSql.query("select last(ts) from stb0") tdSql.query("select last(ts) from stb0")
tdSql.getData(0, 0) tdSql.checkData(0, 0,"2021-07-01 00:00:00.990000000")
# check stable stb1 which is insert with disord # check stable stb1 which is insert with disord
tdSql.query("select count (tbname) from stb1") tdSql.query("select count (tbname) from stb1")
tdSql.checkData(0, 0, 1000) tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from tb1_0") tdSql.query("select count(*) from tb1_0")
tdSql.checkData(0, 0, 10000) tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from stb1") tdSql.query("select count(*) from stb1")
tdSql.checkData(0, 0, 10000000) tdSql.checkData(0, 0, 10000)
# check c8 is an nano timestamp # check c8 is an nano timestamp
tdSql.query("describe stb1") tdSql.query("describe stb1")
tdSql.checkDataType(9, 1,"TIMESTAMP") tdSql.checkDataType(9, 1,"TIMESTAMP")
# check insert timestamp_step is nano_second # check insert timestamp_step is nano_second
tdSql.query("select last(ts) from stb1") tdSql.query("select last(ts) from stb1")
tdSql.checkData(0, 0,"2021-07-01 00:01:39.990000000") tdSql.checkData(0, 0,"2021-07-01 00:00:00.990000000")
# insert data from now time # insert data from now time
# check stable stb0 # check stable stb0
os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoTestNanoDatabaseNow.json -y " % binPath) os.system("%staosdemo -f tools/taosdemoAllTest/taosdemoTestNanoDatabaseNow.json -y " % binPath)
tdSql.execute("use nsdb2") tdSql.execute("use nsdb2")
tdSql.query("show stables") tdSql.query("show stables")
tdSql.checkData(0, 4, 1000) tdSql.checkData(0, 4, 100)
tdSql.query("select count (tbname) from stb0") tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 1000) tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from tb0_0") tdSql.query("select count(*) from tb0_0")
tdSql.checkData(0, 0, 100) tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from stb0") tdSql.query("select count(*) from stb0")
tdSql.checkData(0, 0, 100000) tdSql.checkData(0, 0, 10000)
# check c8 is an nano timestamp # check c8 is an nano timestamp
tdSql.query("describe stb0") tdSql.query("describe stb0")
tdSql.checkDataType(9,1,"TIMESTAMP") tdSql.checkDataType(9,1,"TIMESTAMP")
@ -117,16 +118,11 @@ class TDTestCase:
os.system("rm -rf ./insert_res.txt") os.system("rm -rf ./insert_res.txt")
os.system("rm -rf tools/taosdemoAllTest/taosdemoTestSupportNano*.py.sql") os.system("rm -rf tools/taosdemoAllTest/taosdemoTestSupportNano*.py.sql")
# taosdemo test insert with command and parameter , detals show taosdemo --help # taosdemo test insert with command and parameter , detals show taosdemo --help
os.system("%staosdemo -u root -P taosdata -p 6030 -a 1 -m pre -n 10 -T 20 -t 60 -o res.txt -y " % binPath)
os.system("%staosdemo -u root -P taosdata -p 6030 -h vm84 -a 1 -m pre -n 10 -T 20 -t 60 -o res.txt -y " % binPath)
tdSql.query("select count(*) from test.meters") tdSql.query("select count(*) from test.meters")
tdSql.checkData(0, 0, 600) tdSql.checkData(0, 0, 600)
os.system("%staosdemo -u root -P taosdata -p 6030 -h vm84 -a 1 -m pre -n 10 -T 20 -t 60 -o res.txt -y " % binPath)
tdSql.query("select count(*) from test.meters")
tdSql.checkData(0, 0, 600)
# check taosdemo -s # check taosdemo -s
sqls_ls = ['drop database if exists nsdbsql;','create database nsdbsql precision "ns" keep 36 days 6 update 1;', sqls_ls = ['drop database if exists nsdbsql;','create database nsdbsql precision "ns" keep 36 days 6 update 1;',

View File

@ -55,15 +55,15 @@ class TDTestCase:
# use where to filter # use where to filter
tdSql.query("select count(*) from stb0 where ts>\"2021-07-01 00:01:00.000000000 \" ;") tdSql.query("select count(*) from stb0 where ts>\"2021-07-01 00:00:00.590000000 \" ")
tdSql.checkData(0, 0, 3999000) tdSql.checkData(0, 0, 4000)
tdSql.query("select count(*) from stb0 where ts>\"2021-07-01 00:01:00.000000000\" and ts <=\"2021-07-01 00:01:10.000000000\" ;") tdSql.query("select count(*) from stb0 where ts>\"2021-07-01 00:00:00.000000000\" and ts <=\"2021-07-01 00:00:00.590000000\" ")
tdSql.checkData(0, 0, 1000000) tdSql.checkData(0, 0, 5900)
tdSql.query("select count(*) from tb0_0 where ts>\"2021-07-01 00:01:00.000000000 \" ;") tdSql.query("select count(*) from tb0_0 where ts>\"2021-07-01 00:00:00.590000000 \" ;")
tdSql.checkData(0, 0, 3999) tdSql.checkData(0, 0, 40)
tdSql.query("select count(*) from tb0_0 where ts>\"2021-07-01 00:01:00.000000000\" and ts <=\"2021-07-01 00:01:10.000000000\" ;") tdSql.query("select count(*) from tb0_0 where ts>\"2021-07-01 00:00:00.000000000\" and ts <=\"2021-07-01 00:00:00.590000000\" ")
tdSql.checkData(0, 0, 1000) tdSql.checkData(0, 0, 59)
# select max min avg from special col # select max min avg from special col
@ -87,8 +87,8 @@ class TDTestCase:
print( "select avg(c1) from tb0_0 : " , tdSql.getData(0, 0)) print( "select avg(c1) from tb0_0 : " , tdSql.getData(0, 0))
tdSql.query("select count(*) from stb0 group by tbname;") tdSql.query("select count(*) from stb0 group by tbname;")
tdSql.checkData(0, 0, 10000) tdSql.checkData(0, 0, 100)
tdSql.checkData(100, 0, 10000) tdSql.checkData(10, 0, 100)
# query : query above sqls by taosdemo and continuously # query : query above sqls by taosdemo and continuously
@ -105,7 +105,7 @@ class TDTestCase:
tdSql.checkDataType(3, 1, "TIMESTAMP") tdSql.checkDataType(3, 1, "TIMESTAMP")
tdSql.query("select count(*) from stb0 where ts >\"2021-07-01 00:00:00.490000000\"") tdSql.query("select count(*) from stb0 where ts >\"2021-07-01 00:00:00.490000000\"")
tdSql.checkData(0, 0, 5000) tdSql.checkData(0, 0, 5000)
tdSql.query("select count(*) from stb0 where ts >now -22d-1h-3s") tdSql.query("select count(*) from stb0 where ts <now -1d-1h-3s")
tdSql.checkData(0, 0, 10000) tdSql.checkData(0, 0, 10000)
tdSql.query("select count(*) from stb0 where ts < 1626918583000000000") tdSql.query("select count(*) from stb0 where ts < 1626918583000000000")
tdSql.checkData(0, 0, 10000) tdSql.checkData(0, 0, 10000)

View File

@ -18,7 +18,7 @@
"result": "./query_res0.txt" "result": "./query_res0.txt"
}, },
{ {
"sql": "select count(*) from stb0 where ts > now -22d-1h-3s ;", "sql": "select count(*) from stb0 where ts < now -22d-1h-3s ;",
"result": "./query_res1.txt" "result": "./query_res1.txt"
}, },
{ {

View File

@ -20,7 +20,7 @@
"result": "./subscribe_res0.txt" "result": "./subscribe_res0.txt"
}, },
{ {
"sql": "select * from stb0 where ts > now -20d-1h-3s ;", "sql": "select * from stb0 where ts < now -2d-1h-3s ;",
"result": "./subscribe_res1.txt" "result": "./subscribe_res1.txt"
}, },
{ {

View File

@ -79,7 +79,7 @@ class TDTestCase:
# merge result files # merge result files
sleep(20) sleep(10)
os.system("cat subscribe_res0.txt* > all_subscribe_res0.txt") os.system("cat subscribe_res0.txt* > all_subscribe_res0.txt")
os.system("cat subscribe_res1.txt* > all_subscribe_res1.txt") os.system("cat subscribe_res1.txt* > all_subscribe_res1.txt")
os.system("cat subscribe_res2.txt* > all_subscribe_res2.txt") os.system("cat subscribe_res2.txt* > all_subscribe_res2.txt")
@ -90,7 +90,7 @@ class TDTestCase:
self.assertCheck("all_subscribe_res0.txt",subTimes0 ,200) self.assertCheck("all_subscribe_res0.txt",subTimes0 ,200)
subTimes1 = self.subTimes("all_subscribe_res1.txt") subTimes1 = self.subTimes("all_subscribe_res1.txt")
self.assertCheck("all_subscribe_res1.txt",subTimes1 ,0) self.assertCheck("all_subscribe_res1.txt",subTimes1 ,200)
subTimes2 = self.subTimes("all_subscribe_res2.txt") subTimes2 = self.subTimes("all_subscribe_res2.txt")
self.assertCheck("all_subscribe_res2.txt",subTimes2 ,200) self.assertCheck("all_subscribe_res2.txt",subTimes2 ,200)
@ -103,6 +103,7 @@ class TDTestCase:
os.system("cat subscribe_res0.txt* > all_subscribe_res0.txt") os.system("cat subscribe_res0.txt* > all_subscribe_res0.txt")
subTimes0 = self.subTimes("all_subscribe_res0.txt") subTimes0 = self.subTimes("all_subscribe_res0.txt")
print("pass")
self.assertCheck("all_subscribe_res0.txt",subTimes0 ,202) self.assertCheck("all_subscribe_res0.txt",subTimes0 ,202)
@ -112,6 +113,7 @@ class TDTestCase:
sleep(3) sleep(3)
os.system("rm -rf ./subscribe_res*") os.system("rm -rf ./subscribe_res*")
os.system("rm -rf ./all_subscribe*") os.system("rm -rf ./all_subscribe*")
os.system("rm -rf ./*.py.sql")