From dc4e5e61c12f6e424cdf4274da2b29dc0e2f622f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 14 Jul 2022 14:31:20 +0800 Subject: [PATCH 1/6] test: restore some 2.0 case --- tests/script/general/insert/testSuite.sim | 9 - tests/script/jenkins/basic.txt | 15 +- tests/script/tsim/insert/backquote.sim | 19 +- .../script/{general => tsim}/insert/basic.sim | 4 - tests/script/tsim/insert/basic0.sim | 18 -- tests/script/tsim/insert/basic1.sim | 19 +- tests/script/tsim/insert/commit-merge0.sim | 18 -- .../{general => tsim}/insert/insert_drop.sim | 14 +- tests/script/tsim/insert/null.sim | 164 ++++++++---------- .../insert/query_block1_file.sim | 7 +- .../insert/query_block1_memory.sim | 7 +- .../insert/query_block2_file.sim | 17 +- .../insert/query_block2_memory.sim | 7 +- .../insert/query_file_memory.sim | 16 +- .../insert/query_multi_file.sim | 16 +- tests/script/{general => tsim}/insert/tcp.sim | 5 +- 16 files changed, 97 insertions(+), 258 deletions(-) delete mode 100644 tests/script/general/insert/testSuite.sim rename tests/script/{general => tsim}/insert/basic.sim (93%) rename tests/script/{general => tsim}/insert/insert_drop.sim (89%) rename tests/script/{general => tsim}/insert/query_block1_file.sim (98%) rename tests/script/{general => tsim}/insert/query_block1_memory.sim (97%) rename tests/script/{general => tsim}/insert/query_block2_file.sim (94%) rename tests/script/{general => tsim}/insert/query_block2_memory.sim (97%) rename tests/script/{general => tsim}/insert/query_file_memory.sim (94%) rename tests/script/{general => tsim}/insert/query_multi_file.sim (76%) rename tests/script/{general => tsim}/insert/tcp.sim (91%) diff --git a/tests/script/general/insert/testSuite.sim b/tests/script/general/insert/testSuite.sim deleted file mode 100644 index da44167be5..0000000000 --- a/tests/script/general/insert/testSuite.sim +++ /dev/null @@ -1,9 +0,0 @@ -run general/insert/basic.sim -run general/insert/insert_drop.sim -run general/insert/query_block1_memory.sim -run general/insert/query_block2_memory.sim -run general/insert/query_block1_file.sim -run general/insert/query_block2_file.sim -run general/insert/query_file_memory.sim -run general/insert/query_multi_file.sim -run general/insert/tcp.sim diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 2ba337ddb5..f1264f3cb4 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -52,13 +52,22 @@ ./test.sh -f tsim/import/replica1.sim # ---- insert +./test.sh -f tsim/insert/backquote.sim +./test.sh -f tsim/insert/basic.sim ./test.sh -f tsim/insert/basic0.sim ./test.sh -f tsim/insert/basic1.sim -./test.sh -f tsim/insert/backquote.sim -./test.sh -f tsim/insert/null.sim -./test.sh -f tsim/insert/update0.sim ./test.sh -f tsim/insert/commit-merge0.sim +./test.sh -f tsim/insert/insert_drop.sim ./test.sh -f tsim/insert/insert_select.sim +./test.sh -f tsim/insert/null.sim +./test.sh -f tsim/insert/query_block1_file.sim +./test.sh -f tsim/insert/query_block1_memory.sim +./test.sh -f tsim/insert/query_block2_file.sim +./test.sh -f tsim/insert/query_block2_memory.sim +./test.sh -f tsim/insert/query_file_memory.sim +./test.sh -f tsim/insert/query_multi_file.sim +#./test.sh -f tsim/insert/tcp.sim +./test.sh -f tsim/insert/update0.sim # ---- parser ./test.sh -f tsim/parser/groupby-basic.sim diff --git a/tests/script/tsim/insert/backquote.sim b/tests/script/tsim/insert/backquote.sim index ba50e70afa..db2cddd2ca 100644 --- a/tests/script/tsim/insert/backquote.sim +++ b/tests/script/tsim/insert/backquote.sim @@ -1,9 +1,9 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 50 sql connect + print =============== create database sql create database `database` sql create database `DataBase` @@ -184,23 +184,6 @@ print =============== stop and restart taosd system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - sql show databases print rows: $rows print $data00 $data01 diff --git a/tests/script/general/insert/basic.sim b/tests/script/tsim/insert/basic.sim similarity index 93% rename from tests/script/general/insert/basic.sim rename to tests/script/tsim/insert/basic.sim index 88eb30a1ad..20b39c8f00 100644 --- a/tests/script/general/insert/basic.sim +++ b/tests/script/tsim/insert/basic.sim @@ -1,10 +1,6 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 diff --git a/tests/script/tsim/insert/basic0.sim b/tests/script/tsim/insert/basic0.sim index 722bc0f907..b2fd7587da 100644 --- a/tests/script/tsim/insert/basic0.sim +++ b/tests/script/tsim/insert/basic0.sim @@ -283,30 +283,12 @@ endi # return -1 #endi -#=================================================================== #=================================================================== print =============== stop and restart taosd, then again do query above system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - print =============== query data from child table sql select * from ct1 print rows: $rows diff --git a/tests/script/tsim/insert/basic1.sim b/tests/script/tsim/insert/basic1.sim index d98407b380..cc7f22c007 100644 --- a/tests/script/tsim/insert/basic1.sim +++ b/tests/script/tsim/insert/basic1.sim @@ -1,9 +1,9 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 50 sql connect + print =============== create database sql create database d1 sql show databases @@ -78,23 +78,6 @@ print =============== stop and restart taosd system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - print =============== query data sql select * from c1 print rows: $rows diff --git a/tests/script/tsim/insert/commit-merge0.sim b/tests/script/tsim/insert/commit-merge0.sim index 56e818654f..5fe7cc57b3 100644 --- a/tests/script/tsim/insert/commit-merge0.sim +++ b/tests/script/tsim/insert/commit-merge0.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 50 sql connect print =============== create database @@ -64,23 +63,6 @@ reboot_and_check: system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - print =============== insert duplicated records to memory - loop $reboot_max - $reboot_cnt sql use db sql insert into ct1 values ('2022-05-01 18:30:27.001', 0.0); diff --git a/tests/script/general/insert/insert_drop.sim b/tests/script/tsim/insert/insert_drop.sim similarity index 89% rename from tests/script/general/insert/insert_drop.sim rename to tests/script/tsim/insert/insert_drop.sim index 8592637626..020fd367ae 100644 --- a/tests/script/general/insert/insert_drop.sim +++ b/tests/script/tsim/insert/insert_drop.sim @@ -1,10 +1,6 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $tbNum = 10 @@ -19,7 +15,7 @@ $stb = stb sql drop database $db -x step1 step1: -sql create database $db ctime 30 +sql create database $db print ====== create tables sql use $db sql create table $stb (ts timestamp, c1 int) tags(t1 int) @@ -43,13 +39,9 @@ print ====== tables created print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 3000 system sh/exec.sh -n dnode1 -s start print ================== server restart completed -sql reset query cache -sleep 1000 - sql use $db sql drop table tb5 $i = 0 @@ -69,13 +61,9 @@ endw print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 3000 system sh/exec.sh -n dnode1 -s start print ================== server restart completed -sql reset query cache -sleep 1000 - sql use $db sql create table tb5 using $stb tags(5) diff --git a/tests/script/tsim/insert/null.sim b/tests/script/tsim/insert/null.sim index 98a494c960..1b7017038a 100644 --- a/tests/script/tsim/insert/null.sim +++ b/tests/script/tsim/insert/null.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 50 sql connect print =============== create database @@ -211,66 +210,48 @@ endi #=================================================================== #print =============== query data from stb -#sql select * from stb -#print ===> -#print ===> rows: $rows -#print ===> rows0: $data00 $data01 $data02 $data03 $data04 -#if $rows != 4 then -# return -1 -#endi +sql select * from stb +print ===> +print ===> rows: $rows +print ===> rows0: $data00 $data01 $data02 $data03 $data04 +if $rows != 12 then + return -1 +endi + #print =============== select count(*) from supter table -#sql select count(*) from stb -#print $data00 $data01 $data02 -#if $rows != 1 then -# return -1 -#endi -#if $data00 != 12 then -# return -1 -#endi +sql select count(*) from stb +print $data00 $data01 $data02 +if $rows != 1 then + return -1 +endi +if $data00 != 12 then + return -1 +endi #print =============== select count(column) from supter table -#sql select count(ts), count(c1), count(c2), count(c3) from stb -#print $data00 $data01 $data02 $data03 -#if $data00 != 12 then -# return -1 -#endi -#if $data01 != 8 then -# return -1 -#endi -#if $data02 != 8 then -# return -1 -#endi -#if $data03 != 8 then -# return -1 -#endi +sql select count(ts), count(c1), count(c2), count(c3) from stb +print $data00 $data01 $data02 $data03 +if $data00 != 12 then + return -1 +endi +if $data01 != 8 then + return -1 +endi +if $data02 != 8 then + return -1 +endi +if $data03 != 8 then + return -1 +endi -#=================================================================== #=================================================================== print =============== stop and restart taosd, then again do query above system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -print ===> waiting dnode ready -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi +#=================================================================== -#=================================================================== -#=================================================================== print =============== query data from child table sql select * from ct1 print ===> select * from ct1 @@ -292,15 +273,15 @@ endi if $data03 != 3.000000000 then return -1 endi -#if $data41 != -14 then -# return -1 -#endi -#if $data42 != -2.40000 then -# return -1 -#endi -#if $data43 != -3.400000000 then -# return -1 -#endi +if $data41 != 12 then + return -1 +endi +if $data42 != 2.20000 then + return -1 +endi +if $data43 != NULL then + return -1 +endi print =============== select count(*) from child table sql select count(*) from ct1 @@ -435,40 +416,39 @@ if $data92 != 3.600000000 then return -1 endi #=================================================================== -#=================================================================== -#print =============== query data from stb -#sql select * from stb -#print ===> -#print ===> rows: $rows -#print ===> rows0: $data00 $data01 $data02 $data03 $data04 -#if $rows != 4 then -# return -1 -#endi -#print =============== select count(*) from supter table -#sql select count(*) from stb -#print $data00 $data01 $data02 -#if $rows != 1 then -# return -1 -#endi -#if $data00 != 12 then -# return -1 -#endi +print =============== query data from stb +sql select * from stb +print ===> +print ===> rows: $rows +print ===> rows0: $data00 $data01 $data02 $data03 $data04 +if $rows != 12 then + return -1 +endi +print =============== select count(*) from supter table +sql select count(*) from stb +print $data00 $data01 $data02 +if $rows != 1 then + return -1 +endi +if $data00 != 12 then + return -1 +endi -#print =============== select count(column) from supter table -#sql select count(ts), count(c1), count(c2), count(c3) from stb -#print $data00 $data01 $data02 $data03 -#if $data00 != 12 then -# return -1 -#endi -#if $data01 != 8 then -# return -1 -#endi -#if $data02 != 8 then -# return -1 -#endi -#if $data03 != 8 then -# return -1 -#endi +print =============== select count(column) from supter table +sql select count(ts), count(c1), count(c2), count(c3) from stb +print $data00 $data01 $data02 $data03 +if $data00 != 12 then + return -1 +endi +if $data01 != 8 then + return -1 +endi +if $data02 != 8 then + return -1 +endi +if $data03 != 8 then + return -1 +endi system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/general/insert/query_block1_file.sim b/tests/script/tsim/insert/query_block1_file.sim similarity index 98% rename from tests/script/general/insert/query_block1_file.sim rename to tests/script/tsim/insert/query_block1_file.sim index 636b9530f9..e4e8928bf8 100644 --- a/tests/script/general/insert/query_block1_file.sim +++ b/tests/script/tsim/insert/query_block1_file.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -190,7 +185,7 @@ clear: sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/query_block1_memory.sim b/tests/script/tsim/insert/query_block1_memory.sim similarity index 97% rename from tests/script/general/insert/query_block1_memory.sim rename to tests/script/tsim/insert/query_block1_memory.sim index 823e466ee9..a8e1a0439c 100644 --- a/tests/script/general/insert/query_block1_memory.sim +++ b/tests/script/tsim/insert/query_block1_memory.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -175,7 +170,7 @@ clear: sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/query_block2_file.sim b/tests/script/tsim/insert/query_block2_file.sim similarity index 94% rename from tests/script/general/insert/query_block2_file.sim rename to tests/script/tsim/insert/query_block2_file.sim index 5b7438875e..5557621e0f 100644 --- a/tests/script/general/insert/query_block2_file.sim +++ b/tests/script/tsim/insert/query_block2_file.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -19,15 +14,7 @@ sql drop database -x step1 step1: sql create database $db sql use $db - -$x = 0 -create1: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi -sql create table $tb (ts timestamp, speed int) -x create1 +sql create table $tb (ts timestamp, speed int) #commit to file will trigger if insert 82 rows $N = 82 @@ -204,7 +191,7 @@ clear: sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/query_block2_memory.sim b/tests/script/tsim/insert/query_block2_memory.sim similarity index 97% rename from tests/script/general/insert/query_block2_memory.sim rename to tests/script/tsim/insert/query_block2_memory.sim index fb41981c89..910207d13b 100644 --- a/tests/script/general/insert/query_block2_memory.sim +++ b/tests/script/tsim/insert/query_block2_memory.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -167,7 +162,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/query_file_memory.sim b/tests/script/tsim/insert/query_file_memory.sim similarity index 94% rename from tests/script/general/insert/query_file_memory.sim rename to tests/script/tsim/insert/query_file_memory.sim index f920c215c0..c0aafd2686 100644 --- a/tests/script/general/insert/query_file_memory.sim +++ b/tests/script/tsim/insert/query_file_memory.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -20,14 +15,7 @@ step1: sql create database $db sql use $db -$x = 0 -create1: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi -sql create table $tb (ts timestamp, speed int) -x create1 +sql create table $tb (ts timestamp, speed int) #commit to file will trigger if insert 82 rows @@ -202,7 +190,7 @@ clear: sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/query_multi_file.sim b/tests/script/tsim/insert/query_multi_file.sim similarity index 76% rename from tests/script/general/insert/query_multi_file.sim rename to tests/script/tsim/insert/query_multi_file.sim index bbca53d309..f996317721 100644 --- a/tests/script/general/insert/query_multi_file.sim +++ b/tests/script/tsim/insert/query_multi_file.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -20,14 +15,7 @@ step1: sql create database $db sql use $db -$x = 0 -create1: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi -sql create table $tb (ts timestamp, speed int) -x create1 +sql create table $tb (ts timestamp, speed int) $N = 20000 @@ -49,7 +37,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/tcp.sim b/tests/script/tsim/insert/tcp.sim similarity index 91% rename from tests/script/general/insert/tcp.sim rename to tests/script/tsim/insert/tcp.sim index 002d84dcae..2dc720a0d4 100644 --- a/tests/script/general/insert/tcp.sim +++ b/tests/script/tsim/insert/tcp.sim @@ -1,10 +1,7 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 +system sh/cfg.sh -n dnode1 -c debugflag -v 131 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect sql create database d1; From 7d1c2fdbe5e68dba9fa5567f1f0105862624d6b8 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 14 Jul 2022 15:16:09 +0800 Subject: [PATCH 2/6] test: restore some 2.0 case --- tests/script/jenkins/basic.txt | 24 ++++---- tests/script/tsim/compute/avg.sim | 18 +++--- tests/script/tsim/compute/bottom.sim | 26 ++++----- tests/script/tsim/compute/count.sim | 29 +++++----- tests/script/tsim/compute/diff.sim | 16 +++--- tests/script/tsim/compute/diff2.sim | 70 +++++++++++------------ tests/script/tsim/compute/first.sim | 28 +++++---- tests/script/tsim/compute/interval.sim | 32 +++++------ tests/script/tsim/compute/last.sim | 26 ++++----- tests/script/tsim/compute/last_row.sim | 5 +- tests/script/tsim/compute/leastsquare.sim | 14 ++--- tests/script/tsim/compute/max.sim | 28 +++++---- tests/script/tsim/compute/null.sim | 7 ++- 13 files changed, 155 insertions(+), 168 deletions(-) diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index f1264f3cb4..1e3be5924b 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -236,23 +236,23 @@ ./test.sh -f tsim/compress/uncompress.sim # ---- compute -#./test.sh -f tsim/compute/avg.sim +./test.sh -f tsim/compute/avg.sim #./test.sh -f tsim/compute/block_dist.sim -#./test.sh -f tsim/compute/bottom.sim -#./test.sh -f tsim/compute/count.sim -#./test.sh -f tsim/compute/diff.sim -#./test.sh -f tsim/compute/diff2.sim -#./test.sh -f tsim/compute/first.sim -#./test.sh -f tsim/compute/interval.sim +./test.sh -f tsim/compute/bottom.sim +./test.sh -f tsim/compute/count.sim +./test.sh -f tsim/compute/diff.sim +./test.sh -f tsim/compute/diff2.sim +./test.sh -f tsim/compute/first.sim +./test.sh -f tsim/compute/interval.sim #./test.sh -f tsim/compute/last_row.sim -#./test.sh -f tsim/compute/last.sim -#./test.sh -f tsim/compute/leastsquare.sim -#./test.sh -f tsim/compute/max.sim -#./test.sh -f tsim/compute/min.sim +./test.sh -f tsim/compute/last.sim +./test.sh -f tsim/compute/leastsquare.sim +./test.sh -f tsim/compute/max.sim +./test.sh -f tsim/compute/min.sim #./test.sh -f tsim/compute/null.sim ./test.sh -f tsim/compute/percentile.sim ./test.sh -f tsim/compute/stddev.sim -#./test.sh -f tsim/compute/sum.sim +./test.sh -f tsim/compute/sum.sim ./test.sh -f tsim/compute/top.sim # ---- field diff --git a/tests/script/tsim/compute/avg.sim b/tests/script/tsim/compute/avg.sim index 2805b65fff..50a0aeffb0 100644 --- a/tests/script/tsim/compute/avg.sim +++ b/tests/script/tsim/compute/avg.sim @@ -69,13 +69,13 @@ endi print =============== step5 sql select avg(tbcol) as b from $tb interval(1m) print ===> $data01 -if $data11 != 1.000000000 then +if $data10 != 1.000000000 then return -1 endi sql select avg(tbcol) as b from $tb interval(1d) print ===> $data01 -if $data01 != 9.500000000 then +if $data00 != 9.500000000 then return -1 endi @@ -84,7 +84,7 @@ $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select avg(tbcol) as b from $tb where ts <= $ms interval(1m) print ===> $data01 -if $data41 != 4.000000000 then +if $data40 != 4.000000000 then return -1 endi if $rows != 5 then @@ -123,14 +123,14 @@ endi print =============== step9 sql select avg(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1.000000000 then +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi sql select avg(tbcol) as b from $mt interval(1d) print ===> $data01 -if $data01 != 9.500000000 then +if $data00 != 9.500000000 then return -1 endi @@ -148,9 +148,9 @@ endi print =============== step11 $cc = 4 * 60000 $ms = 1601481600000 + $cc -sql select avg(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1.000000000 then +sql select avg(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m) +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi if $rows != 50 then diff --git a/tests/script/tsim/compute/bottom.sim b/tests/script/tsim/compute/bottom.sim index cfac02d6d5..a17584734b 100644 --- a/tests/script/tsim/compute/bottom.sim +++ b/tests/script/tsim/compute/bottom.sim @@ -38,15 +38,13 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i sql select bottom(tbcol, 1) from $tb -print ===> $data01 -if $data01 != 0 then +print ===> $data00 +if $data00 != 0 then return -1 endi @@ -54,25 +52,25 @@ print =============== step3 $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select bottom(tbcol, 1) from $tb where ts > $ms -print ===> $data01 -if $data01 != 5 then +print ===> $data00 +if $data00 != 5 then return -1 endi print =============== step4 sql select bottom(tbcol, 1) as b from $tb -print ===> $data01 -if $data01 != 0 then +print ===> $data00 +if $data00 != 0 then return -1 endi print =============== step5 sql select bottom(tbcol, 2) as b from $tb -print ===> $data01 $data11 -if $data01 != 0 then +print ===> $data00 $data10 +if $data00 != 1 then return -1 endi -if $data11 != 1 then +if $data10 != 0 then return -1 endi @@ -80,11 +78,11 @@ print =============== step6 $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select bottom(tbcol, 2) as b from $tb where ts > $ms -print ===> $data01 $data11 -if $data01 != 5 then +print ===> $data00 $data10 +if $data00 != 6 then return -1 endi -if $data11 != 6 then +if $data10 != 5 then return -1 endi diff --git a/tests/script/tsim/compute/count.sim b/tests/script/tsim/compute/count.sim index 0a6ce93077..cf2ad933bc 100644 --- a/tests/script/tsim/compute/count.sim +++ b/tests/script/tsim/compute/count.sim @@ -38,13 +38,10 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i - sql select count(*) from $tb print ===> select count(*) from $tb => $data00 if $data00 != $rowNum then @@ -81,14 +78,14 @@ endi print =============== step5 sql select count(tbcol) as b from $tb interval(1m) -print ===> $data01 -if $data01 != 1 then +print ===> $data00 +if $data00 != 1 then return -1 endi sql select count(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != $rowNum then +print ===> $data00 +if $data00 != $rowNum then return -1 endi @@ -96,8 +93,8 @@ print =============== step6 $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select count(tbcol) as b from $tb where ts <= $ms interval(1m) -print ===> $data01 -if $data01 != 1 then +print ===> $data00 +if $data00 != 1 then return -1 endi if $rows != 5 then @@ -149,17 +146,17 @@ endi print =============== step9 sql select count(tbcol) as b from $mt interval(1m) -print ===> $data01 -if $data01 != 10 then +print ===> $data00 +if $data00 != 10 then return -1 endi -if $data11 != 10 then +if $data10 != 10 then return -1 endi sql select count(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 200 then +print ===> $data00 +if $data00 != 200 then return -1 endi @@ -177,9 +174,9 @@ endi print =============== step11 $cc = 4 * 60000 $ms = 1601481600000 + $cc -sql select count(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol +sql select count(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m) print ===> $data01 -if $data01 != 1 then +if $data00 != 1 then return -1 endi if $rows != 50 then diff --git a/tests/script/tsim/compute/diff.sim b/tests/script/tsim/compute/diff.sim index ba4b32ddbb..f11fc92b2b 100644 --- a/tests/script/tsim/compute/diff.sim +++ b/tests/script/tsim/compute/diff.sim @@ -44,8 +44,8 @@ $i = 1 $tb = $tbPrefix . $i sql select diff(tbcol) from $tb -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi @@ -53,23 +53,23 @@ print =============== step3 $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select diff(tbcol) from $tb where ts > $ms -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select diff(tbcol) from $tb where ts <= $ms -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi print =============== step4 sql select diff(tbcol) as b from $tb -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi diff --git a/tests/script/tsim/compute/diff2.sim b/tests/script/tsim/compute/diff2.sim index 08b52cb37b..021fcf6e8b 100644 --- a/tests/script/tsim/compute/diff2.sim +++ b/tests/script/tsim/compute/diff2.sim @@ -1,5 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c debugflag -v 131 system sh/exec.sh -n dnode1 -s start sql connect @@ -39,91 +40,90 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i sql select diff(c1) from $tb -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c2) from $tb -print ===> $data11 -if $data11 != 1.00000 then +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi sql select diff(c3) from $tb -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c4) from $tb -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c5) from $tb -print ===> $data11 -if $data11 != 0 then +print ===> $data10 +if $data10 != 0 then return -1 endi sql select diff(c6) from $tb -print ===> $data11 -if $data11 != 1.000000000 then +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi -sql_error select diff(c7) from $tb + +sql select diff(c7) from $tb sql_error select diff(c8) from $tb sql_error select diff(c9) from $tb sql_error select diff(ts) from $tb sql_error select diff(c1), diff(c2) from $tb -#sql_error select 2+diff(c1) from $tb -sql_error select diff(c1+2) from $tb + +sql select 2+diff(c1) from $tb +sql select diff(c1+2) from $tb sql_error select diff(c1) from $tb where ts > 0 and ts < now + 100m interval(10m) -sql_error select diff(c1) from $mt +sql select diff(c1) from $mt sql_error select diff(diff(c1)) from $tb sql_error select diff(c1) from m_di_tb1 where c2 like '2%' - print =============== step3 sql select diff(c1) from $tb where c1 > 5 -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c2) from $tb where c2 > 5 -print ===> $data11 -if $data11 != 1.00000 then +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi sql select diff(c3) from $tb where c3 > 5 -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c4) from $tb where c4 > 5 -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c5) from $tb where c5 > 5 -print ===> $data11 -if $data11 != 0 then +print ===> $data10 +if $data10 != 0 then return -1 endi sql select diff(c6) from $tb where c6 > 5 -print ===> $data11 -if $data11 != 1.000000000 then +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi print =============== step4 sql select diff(c1) from $tb where c1 > 5 and c2 < $rowNum -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi @@ -131,8 +131,8 @@ sql select diff(c1) from $tb where c9 like '%9' and c1 <= 20 if $rows != 1 then return -1 endi -print ===> $data11 -if $data01 != 10 then +print ===> $data10 +if $data00 != 10 then return -1 endi diff --git a/tests/script/tsim/compute/first.sim b/tests/script/tsim/compute/first.sim index cf1160dbdb..f8efeee513 100644 --- a/tests/script/tsim/compute/first.sim +++ b/tests/script/tsim/compute/first.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i @@ -68,14 +66,14 @@ endi print =============== step5 sql select first(tbcol) as b from $tb interval(1m) -print ===> $data01 -if $data01 != 0 then +print ===> $data00 +if $data00 != 0 then return -1 endi sql select first(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 0 then +print ===> $data00 +if $data00 != 0 then return -1 endi @@ -83,8 +81,8 @@ print =============== step6 $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select first(tbcol) as b from $tb where ts <= $ms interval(1m) -print ===> $data01 -if $data41 != 4 then +print ===> $data00 +if $data40 != 4 then return -1 endi if $rows != 5 then @@ -124,14 +122,14 @@ endi print =============== step9 sql select first(tbcol) as b from $mt interval(1m) print select first(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select first(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 0 then +print ===> $data00 +if $data00 != 0 then return -1 endi @@ -149,9 +147,9 @@ endi print =============== step11 $cc = 4 * 60000 $ms = 1601481600000 + $cc -sql select first(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1 then +sql select first(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m) +print ===> $data10 +if $data10 != 1 then return -1 endi print ===> $rows diff --git a/tests/script/tsim/compute/interval.sim b/tests/script/tsim/compute/interval.sim index a8539701c7..2e38990975 100644 --- a/tests/script/tsim/compute/interval.sim +++ b/tests/script/tsim/compute/interval.sim @@ -47,10 +47,10 @@ print ===> $rows if $rows < $rowNum then return -1 endi -if $data01 != 1 then +if $data00 != 1 then return -1 endi -if $data05 != 1 then +if $data04 != 1 then return -1 endi @@ -65,10 +65,10 @@ endi if $rows < 3 then return -1 endi -if $data01 != 1 then +if $data00 != 1 then return -1 endi -if $data05 != 1 then +if $data04 != 1 then return -1 endi @@ -87,10 +87,10 @@ endi if $rows > 22 then return -1 endi -if $data01 != 1 then +if $data00 != 1 then return -1 endi -if $data05 != 1 then +if $data04 != 1 then return -1 endi @@ -109,10 +109,10 @@ endi if $rows > 50 then return -1 endi -if $data21 != 1 then +if $data20 != 1 then return -1 endi -if $data25 != 1 then +if $data24 != 1 then return -1 endi @@ -125,10 +125,10 @@ endi if $rows > 22 then return -1 endi -if $data11 > 15 then +if $data10 > 15 then return -1 endi -if $data11 < 5 then +if $data10 < 5 then return -1 endi @@ -143,10 +143,10 @@ endi if $rows > 7 then return -1 endi -if $data11 > 15 then +if $data10 > 15 then return -1 endi -if $data11 < 5 then +if $data10 < 5 then return -1 endi @@ -165,10 +165,10 @@ endi if $rows > 22 then return -1 endi -if $data11 > 15 then +if $data10 > 15 then return -1 endi -if $data11 < 5 then +if $data10 < 5 then return -1 endi @@ -186,10 +186,10 @@ endi if $rows > 50 then return -1 endi -if $data11 > 15 then +if $data10 > 15 then return -1 endi -if $data11 < 5 then +if $data10 < 5 then return -1 endi diff --git a/tests/script/tsim/compute/last.sim b/tests/script/tsim/compute/last.sim index aa9b041ca9..ae6f016b08 100644 --- a/tests/script/tsim/compute/last.sim +++ b/tests/script/tsim/compute/last.sim @@ -69,14 +69,14 @@ endi print =============== step5 sql select last(tbcol) as b from $tb interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select last(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 19 then +print ===> $data00 +if $data00 != 19 then return -1 endi @@ -85,8 +85,8 @@ $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select last(tbcol) as b from $tb where ts <= $ms interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi if $rows != 5 then @@ -127,14 +127,14 @@ endi print =============== step9 sql select last(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select last(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 19 then +print ===> $data00 +if $data00 != 19 then return -1 endi @@ -153,9 +153,9 @@ print =============== step11 $cc = 4 * 60000 $ms = 1601481600000 + $cc -sql select last(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1 then +sql select last(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m) +print ===> $data10 +if $data10 != 1 then return -1 endi print ===> $rows diff --git a/tests/script/tsim/compute/last_row.sim b/tests/script/tsim/compute/last_row.sim index 867f64fa2e..590fada86a 100644 --- a/tests/script/tsim/compute/last_row.sim +++ b/tests/script/tsim/compute/last_row.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i @@ -53,6 +51,7 @@ endi print =============== step3 $cc = 4 * 60000 $ms = 1601481600000 + $cc +print select last_row(tbcol) from $tb where ts <= $ms sql select last_row(tbcol) from $tb where ts <= $ms print ===> $data00 if $data00 != 4 then @@ -98,8 +97,6 @@ if $data00 != 4 then return -1 endi - - print =============== step10 sql select last_row(tbcol) as b from $mt group by tgcol print ===> $data00 diff --git a/tests/script/tsim/compute/leastsquare.sim b/tests/script/tsim/compute/leastsquare.sim index aa83a4e14e..59a5213620 100644 --- a/tests/script/tsim/compute/leastsquare.sim +++ b/tests/script/tsim/compute/leastsquare.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i @@ -65,21 +63,21 @@ endi print =============== step5 sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m) -print ===> $data01 -if $data01 != @{slop:1.000000, intercept:1.000000}@ then +print ===> $data00 +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d) -print ===> $data01 -if $data01 != @{slop:1.000000, intercept:1.000000}@ then +print ===> $data00 +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print =============== step6 sql select leastsquares(tbcol, 1, 1) as b from $tb where ts < now + 4m interval(1m) -print ===> $data01 -if $data01 != @{slop:1.000000, intercept:1.000000}@ then +print ===> $data00 +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print ===> $rows diff --git a/tests/script/tsim/compute/max.sim b/tests/script/tsim/compute/max.sim index 1b3fac5820..7101359026 100644 --- a/tests/script/tsim/compute/max.sim +++ b/tests/script/tsim/compute/max.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i @@ -69,14 +67,14 @@ endi print =============== step5 sql select max(tbcol) as b from $tb interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select max(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 19 then +print ===> $data00 +if $data00 != 19 then return -1 endi @@ -85,8 +83,8 @@ $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select max(tbcol) as b from $tb where ts <= $ms interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi if $rows != 5 then @@ -127,14 +125,14 @@ endi print =============== step9 sql select max(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select max(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 19 then +print ===> $data00 +if $data00 != 19 then return -1 endi @@ -153,9 +151,9 @@ print =============== step11 $cc = 4 * 60000 $ms = 1601481600000 + $cc -sql select max(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1 then +sql select max(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m) +print ===> $data10 +if $data10 != 1 then return -1 endi print ===> $rows diff --git a/tests/script/tsim/compute/null.sim b/tests/script/tsim/compute/null.sim index 30860da48b..b5647a1e34 100644 --- a/tests/script/tsim/compute/null.sim +++ b/tests/script/tsim/compute/null.sim @@ -100,9 +100,10 @@ if $rows != 1 then return -1 endi -sql_error select * from $tb where tbcol = NULL - -return +sql select * from $tb where tbcol = NULL +if $rows != 0 then + return -1 +endi print =============== step5 sql create table tt using $mt tags( NULL ) From 9b5f662275a28e9b05c1d19e0d767492cde3b72c Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 14 Jul 2022 15:16:18 +0800 Subject: [PATCH 3/6] test: restore some 2.0 case --- tests/script/tsim/cache/new_metrics.sim | 4 ---- tests/script/tsim/cache/restart_metrics.sim | 2 -- tests/script/tsim/cache/restart_table.sim | 2 -- tests/script/tsim/compress/commitlog.sim | 10 +--------- tests/script/tsim/compute/avg.sim | 2 -- tests/script/tsim/compute/block_dist.sim | 2 -- tests/script/tsim/compute/diff.sim | 2 -- tests/script/tsim/compute/last.sim | 2 -- tests/script/tsim/compute/min.sim | 2 -- tests/script/tsim/compute/percentile.sim | 2 -- tests/script/tsim/compute/stddev.sim | 2 -- tests/script/tsim/compute/sum.sim | 2 -- tests/script/tsim/compute/top.sim | 2 -- tests/script/tsim/tag/bigint.sim | 1 - tests/script/tsim/tag/binary.sim | 1 - tests/script/tsim/tag/bool.sim | 1 - tests/script/tsim/tag/double.sim | 1 - tests/script/tsim/tag/float.sim | 1 - tests/script/tsim/tag/int.sim | 1 - tests/script/tsim/tag/smallint.sim | 1 - tests/script/tsim/tag/tinyint.sim | 1 - tests/script/tsim/vector/metrics_field.sim | 2 -- tests/script/tsim/vector/metrics_mix.sim | 2 -- tests/script/tsim/vector/metrics_query.sim | 2 -- tests/script/tsim/vector/metrics_tag.sim | 2 -- tests/script/tsim/vector/metrics_time.sim | 2 -- tests/script/tsim/vector/multi.sim | 2 -- tests/script/tsim/vector/single.sim | 2 -- tests/script/tsim/vector/table_field.sim | 2 -- tests/script/tsim/vector/table_mix.sim | 2 -- tests/script/tsim/vector/table_query.sim | 2 -- tests/script/tsim/vector/table_time.sim | 2 -- 32 files changed, 1 insertion(+), 65 deletions(-) diff --git a/tests/script/tsim/cache/new_metrics.sim b/tests/script/tsim/cache/new_metrics.sim index af7db90070..82d7d43e0f 100644 --- a/tests/script/tsim/cache/new_metrics.sim +++ b/tests/script/tsim/cache/new_metrics.sim @@ -83,10 +83,6 @@ while $i < 10 $i = $i + 1 endw -print ==> sleep 1 seconds to renew cache -sql reset query cache -sleep 1000 - print =============== step5 sql select * from $tb order by ts desc print ===>rows $rows, data $data01 diff --git a/tests/script/tsim/cache/restart_metrics.sim b/tests/script/tsim/cache/restart_metrics.sim index e144a49bf7..e346357633 100644 --- a/tests/script/tsim/cache/restart_metrics.sim +++ b/tests/script/tsim/cache/restart_metrics.sim @@ -48,9 +48,7 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start print =============== step3 -print ==> sleep 1 seconds to renew cache sql reset query cache -sleep 1000 print =============== step4 sql create database $db diff --git a/tests/script/tsim/cache/restart_table.sim b/tests/script/tsim/cache/restart_table.sim index b450f6c654..d28ef51419 100644 --- a/tests/script/tsim/cache/restart_table.sim +++ b/tests/script/tsim/cache/restart_table.sim @@ -32,9 +32,7 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start print =============== step3 -print ==> sleep 1 seconds to renew cache sql reset query cache -sleep 1000 print =============== step4 sql create database $db diff --git a/tests/script/tsim/compress/commitlog.sim b/tests/script/tsim/compress/commitlog.sim index d90780bd6c..bc9c231a9e 100644 --- a/tests/script/tsim/compress/commitlog.sim +++ b/tests/script/tsim/compress/commitlog.sim @@ -57,15 +57,7 @@ $tb = $tbPrefix . $i sql create database $db sql use $db - -$x = 0 -step3: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi -sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256)) -x step3 +sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256)) $count = 0 while $count < $N diff --git a/tests/script/tsim/compute/avg.sim b/tests/script/tsim/compute/avg.sim index 50a0aeffb0..c366de5f4c 100644 --- a/tests/script/tsim/compute/avg.sim +++ b/tests/script/tsim/compute/avg.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/block_dist.sim b/tests/script/tsim/compute/block_dist.sim index 201d222af7..1583e838c6 100644 --- a/tests/script/tsim/compute/block_dist.sim +++ b/tests/script/tsim/compute/block_dist.sim @@ -47,8 +47,6 @@ while $x < $rowNum $x = $x + 1 endw -sleep 100 - print =============== step2 $i = 0 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/diff.sim b/tests/script/tsim/compute/diff.sim index f11fc92b2b..6043f18b27 100644 --- a/tests/script/tsim/compute/diff.sim +++ b/tests/script/tsim/compute/diff.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/last.sim b/tests/script/tsim/compute/last.sim index ae6f016b08..6080a2fa97 100644 --- a/tests/script/tsim/compute/last.sim +++ b/tests/script/tsim/compute/last.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/min.sim b/tests/script/tsim/compute/min.sim index 33e9eb0f3e..1ffdf19ac2 100644 --- a/tests/script/tsim/compute/min.sim +++ b/tests/script/tsim/compute/min.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/percentile.sim b/tests/script/tsim/compute/percentile.sim index 5cba3ad856..93b4640442 100644 --- a/tests/script/tsim/compute/percentile.sim +++ b/tests/script/tsim/compute/percentile.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/stddev.sim b/tests/script/tsim/compute/stddev.sim index 7048399112..dbdcde9a16 100644 --- a/tests/script/tsim/compute/stddev.sim +++ b/tests/script/tsim/compute/stddev.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/sum.sim b/tests/script/tsim/compute/sum.sim index c53568f98f..950b861b4c 100644 --- a/tests/script/tsim/compute/sum.sim +++ b/tests/script/tsim/compute/sum.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/top.sim b/tests/script/tsim/compute/top.sim index 9899a8a9ea..d10b3803e3 100644 --- a/tests/script/tsim/compute/top.sim +++ b/tests/script/tsim/compute/top.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/tag/bigint.sim b/tests/script/tsim/tag/bigint.sim index 813387eb38..565688270c 100644 --- a/tests/script/tsim/tag/bigint.sim +++ b/tests/script/tsim/tag/bigint.sim @@ -46,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 diff --git a/tests/script/tsim/tag/binary.sim b/tests/script/tsim/tag/binary.sim index 6ede988954..f3f89d6659 100644 --- a/tests/script/tsim/tag/binary.sim +++ b/tests/script/tsim/tag/binary.sim @@ -46,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 diff --git a/tests/script/tsim/tag/bool.sim b/tests/script/tsim/tag/bool.sim index 356269e1e1..25c7b2d967 100644 --- a/tests/script/tsim/tag/bool.sim +++ b/tests/script/tsim/tag/bool.sim @@ -46,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 diff --git a/tests/script/tsim/tag/double.sim b/tests/script/tsim/tag/double.sim index fedc1c89ec..b8292b64e8 100644 --- a/tests/script/tsim/tag/double.sim +++ b/tests/script/tsim/tag/double.sim @@ -46,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 diff --git a/tests/script/tsim/tag/float.sim b/tests/script/tsim/tag/float.sim index 0ed12d2269..26a09e2973 100644 --- a/tests/script/tsim/tag/float.sim +++ b/tests/script/tsim/tag/float.sim @@ -46,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 diff --git a/tests/script/tsim/tag/int.sim b/tests/script/tsim/tag/int.sim index e561cde56a..13255eb2ba 100644 --- a/tests/script/tsim/tag/int.sim +++ b/tests/script/tsim/tag/int.sim @@ -46,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 diff --git a/tests/script/tsim/tag/smallint.sim b/tests/script/tsim/tag/smallint.sim index 47e28db46c..70c5ee0771 100644 --- a/tests/script/tsim/tag/smallint.sim +++ b/tests/script/tsim/tag/smallint.sim @@ -46,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 diff --git a/tests/script/tsim/tag/tinyint.sim b/tests/script/tsim/tag/tinyint.sim index 0941c9cf18..b7f7616cf4 100644 --- a/tests/script/tsim/tag/tinyint.sim +++ b/tests/script/tsim/tag/tinyint.sim @@ -46,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 diff --git a/tests/script/tsim/vector/metrics_field.sim b/tests/script/tsim/vector/metrics_field.sim index 4d0f9e19fc..b75ba9cffe 100644 --- a/tests/script/tsim/vector/metrics_field.sim +++ b/tests/script/tsim/vector/metrics_field.sim @@ -41,8 +41,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/metrics_mix.sim b/tests/script/tsim/vector/metrics_mix.sim index fd36a62332..fa93f0b2e3 100644 --- a/tests/script/tsim/vector/metrics_mix.sim +++ b/tests/script/tsim/vector/metrics_mix.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/metrics_query.sim b/tests/script/tsim/vector/metrics_query.sim index 8a334acef2..5d433486e8 100644 --- a/tests/script/tsim/vector/metrics_query.sim +++ b/tests/script/tsim/vector/metrics_query.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/metrics_tag.sim b/tests/script/tsim/vector/metrics_tag.sim index 0b275336f9..c8380590d5 100644 --- a/tests/script/tsim/vector/metrics_tag.sim +++ b/tests/script/tsim/vector/metrics_tag.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/metrics_time.sim b/tests/script/tsim/vector/metrics_time.sim index bcd93cb582..efa1ae4c84 100644 --- a/tests/script/tsim/vector/metrics_time.sim +++ b/tests/script/tsim/vector/metrics_time.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/multi.sim b/tests/script/tsim/vector/multi.sim index dcedbe73c9..1b592cdd0a 100644 --- a/tests/script/tsim/vector/multi.sim +++ b/tests/script/tsim/vector/multi.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/single.sim b/tests/script/tsim/vector/single.sim index c9d794456c..4da7c78110 100644 --- a/tests/script/tsim/vector/single.sim +++ b/tests/script/tsim/vector/single.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/table_field.sim b/tests/script/tsim/vector/table_field.sim index 5ad60b2a35..d5bdad8be2 100644 --- a/tests/script/tsim/vector/table_field.sim +++ b/tests/script/tsim/vector/table_field.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/table_mix.sim b/tests/script/tsim/vector/table_mix.sim index 358d6cf87f..79ecb09d81 100644 --- a/tests/script/tsim/vector/table_mix.sim +++ b/tests/script/tsim/vector/table_mix.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/table_query.sim b/tests/script/tsim/vector/table_query.sim index 0e4562716e..d69d16eba5 100644 --- a/tests/script/tsim/vector/table_query.sim +++ b/tests/script/tsim/vector/table_query.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/table_time.sim b/tests/script/tsim/vector/table_time.sim index 1e6bdb2cde..f16c95ad4a 100644 --- a/tests/script/tsim/vector/table_time.sim +++ b/tests/script/tsim/vector/table_time.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i From 68ced4523ef2aa1e66af4e60af4f9f7d01a6ceb9 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 14 Jul 2022 15:21:02 +0800 Subject: [PATCH 4/6] test: restore some 2.0 case --- tests/script/jenkins/basic.txt | 27 +++++++++++++++++++ .../{general => tsim}/table/autocreate.sim | 0 .../{general => tsim}/table/back_insert.sim | 0 .../script/{general => tsim}/table/basic2.sim | 0 .../script/{general => tsim}/table/basic3.sim | 0 .../script/{general => tsim}/table/bigint.sim | 0 .../script/{general => tsim}/table/binary.sim | 0 tests/script/{general => tsim}/table/bool.sim | 0 .../{general => tsim}/table/column2.sim | 0 .../{general => tsim}/table/column_name.sim | 0 .../{general => tsim}/table/column_num.sim | 0 .../{general => tsim}/table/column_value.sim | 0 .../{general => tsim}/table/createmulti.sim | 0 tests/script/{general => tsim}/table/date.sim | 0 .../{general => tsim}/table/db.table.sim | 0 .../{general => tsim}/table/delete_reuse1.sim | 0 .../{general => tsim}/table/delete_reuse2.sim | 0 .../table/delete_writing.sim | 0 .../{general => tsim}/table/describe.sim | 0 .../script/{general => tsim}/table/double.sim | 0 .../script/{general => tsim}/table/float.sim | 0 tests/script/{general => tsim}/table/int.sim | 0 .../script/{general => tsim}/table/limit.sim | 0 .../{general => tsim}/table/smallint.sim | 0 .../script/{general => tsim}/table/table.sim | 0 .../{general => tsim}/table/table_len.sim | 0 .../{general => tsim}/table/testSuite.sim | 0 .../{general => tsim}/table/tinyint.sim | 0 .../script/{general => tsim}/table/vgroup.sim | 0 29 files changed, 27 insertions(+) rename tests/script/{general => tsim}/table/autocreate.sim (100%) rename tests/script/{general => tsim}/table/back_insert.sim (100%) rename tests/script/{general => tsim}/table/basic2.sim (100%) rename tests/script/{general => tsim}/table/basic3.sim (100%) rename tests/script/{general => tsim}/table/bigint.sim (100%) rename tests/script/{general => tsim}/table/binary.sim (100%) rename tests/script/{general => tsim}/table/bool.sim (100%) rename tests/script/{general => tsim}/table/column2.sim (100%) rename tests/script/{general => tsim}/table/column_name.sim (100%) rename tests/script/{general => tsim}/table/column_num.sim (100%) rename tests/script/{general => tsim}/table/column_value.sim (100%) rename tests/script/{general => tsim}/table/createmulti.sim (100%) rename tests/script/{general => tsim}/table/date.sim (100%) rename tests/script/{general => tsim}/table/db.table.sim (100%) rename tests/script/{general => tsim}/table/delete_reuse1.sim (100%) rename tests/script/{general => tsim}/table/delete_reuse2.sim (100%) rename tests/script/{general => tsim}/table/delete_writing.sim (100%) rename tests/script/{general => tsim}/table/describe.sim (100%) rename tests/script/{general => tsim}/table/double.sim (100%) rename tests/script/{general => tsim}/table/float.sim (100%) rename tests/script/{general => tsim}/table/int.sim (100%) rename tests/script/{general => tsim}/table/limit.sim (100%) rename tests/script/{general => tsim}/table/smallint.sim (100%) rename tests/script/{general => tsim}/table/table.sim (100%) rename tests/script/{general => tsim}/table/table_len.sim (100%) rename tests/script/{general => tsim}/table/testSuite.sim (100%) rename tests/script/{general => tsim}/table/tinyint.sim (100%) rename tests/script/{general => tsim}/table/vgroup.sim (100%) diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 7ab2c644ee..2c7170d40b 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -103,7 +103,34 @@ ./test.sh -f tsim/show/basic.sim # ---- table +# ./test.sh -f tsim/table/autocreate.sim ./test.sh -f tsim/table/basic1.sim +# ./test.sh -f tsim/table/basic2.sim +# ./test.sh -f tsim/table/basic3.sim +# ./test.sh -f tsim/table/bigint.sim +# ./test.sh -f tsim/table/binary.sim +# ./test.sh -f tsim/table/bool.sim +# ./test.sh -f tsim/table/column_name.sim +# ./test.sh -f tsim/table/column_num.sim +# ./test.sh -f tsim/table/column_value.sim +# ./test.sh -f tsim/table/column2.sim +# ./test.sh -f tsim/table/createmulti.sim +# ./test.sh -f tsim/table/date.sim +# ./test.sh -f tsim/table/db.table.sim +# ./test.sh -f tsim/table/delete_reuse1.sim +# ./test.sh -f tsim/table/delete_reuse2.sim +# ./test.sh -f tsim/table/delete_writing.sim +# ./test.sh -f tsim/table/describe.sim +# ./test.sh -f tsim/table/double.sim +# ./test.sh -f tsim/table/fill.sim +# ./test.sh -f tsim/table/float.sim +# ./test.sh -f tsim/table/int.sim +# ./test.sh -f tsim/table/limit.sim +# ./test.sh -f tsim/table/smallint.sim +# ./test.sh -f tsim/table/table_len.sim +# ./test.sh -f tsim/table/table.sim +# ./test.sh -f tsim/table/tinyint.sim +# ./test.sh -f tsim/table/vgroup.sim # ---- stream ./test.sh -f tsim/stream/basic0.sim diff --git a/tests/script/general/table/autocreate.sim b/tests/script/tsim/table/autocreate.sim similarity index 100% rename from tests/script/general/table/autocreate.sim rename to tests/script/tsim/table/autocreate.sim diff --git a/tests/script/general/table/back_insert.sim b/tests/script/tsim/table/back_insert.sim similarity index 100% rename from tests/script/general/table/back_insert.sim rename to tests/script/tsim/table/back_insert.sim diff --git a/tests/script/general/table/basic2.sim b/tests/script/tsim/table/basic2.sim similarity index 100% rename from tests/script/general/table/basic2.sim rename to tests/script/tsim/table/basic2.sim diff --git a/tests/script/general/table/basic3.sim b/tests/script/tsim/table/basic3.sim similarity index 100% rename from tests/script/general/table/basic3.sim rename to tests/script/tsim/table/basic3.sim diff --git a/tests/script/general/table/bigint.sim b/tests/script/tsim/table/bigint.sim similarity index 100% rename from tests/script/general/table/bigint.sim rename to tests/script/tsim/table/bigint.sim diff --git a/tests/script/general/table/binary.sim b/tests/script/tsim/table/binary.sim similarity index 100% rename from tests/script/general/table/binary.sim rename to tests/script/tsim/table/binary.sim diff --git a/tests/script/general/table/bool.sim b/tests/script/tsim/table/bool.sim similarity index 100% rename from tests/script/general/table/bool.sim rename to tests/script/tsim/table/bool.sim diff --git a/tests/script/general/table/column2.sim b/tests/script/tsim/table/column2.sim similarity index 100% rename from tests/script/general/table/column2.sim rename to tests/script/tsim/table/column2.sim diff --git a/tests/script/general/table/column_name.sim b/tests/script/tsim/table/column_name.sim similarity index 100% rename from tests/script/general/table/column_name.sim rename to tests/script/tsim/table/column_name.sim diff --git a/tests/script/general/table/column_num.sim b/tests/script/tsim/table/column_num.sim similarity index 100% rename from tests/script/general/table/column_num.sim rename to tests/script/tsim/table/column_num.sim diff --git a/tests/script/general/table/column_value.sim b/tests/script/tsim/table/column_value.sim similarity index 100% rename from tests/script/general/table/column_value.sim rename to tests/script/tsim/table/column_value.sim diff --git a/tests/script/general/table/createmulti.sim b/tests/script/tsim/table/createmulti.sim similarity index 100% rename from tests/script/general/table/createmulti.sim rename to tests/script/tsim/table/createmulti.sim diff --git a/tests/script/general/table/date.sim b/tests/script/tsim/table/date.sim similarity index 100% rename from tests/script/general/table/date.sim rename to tests/script/tsim/table/date.sim diff --git a/tests/script/general/table/db.table.sim b/tests/script/tsim/table/db.table.sim similarity index 100% rename from tests/script/general/table/db.table.sim rename to tests/script/tsim/table/db.table.sim diff --git a/tests/script/general/table/delete_reuse1.sim b/tests/script/tsim/table/delete_reuse1.sim similarity index 100% rename from tests/script/general/table/delete_reuse1.sim rename to tests/script/tsim/table/delete_reuse1.sim diff --git a/tests/script/general/table/delete_reuse2.sim b/tests/script/tsim/table/delete_reuse2.sim similarity index 100% rename from tests/script/general/table/delete_reuse2.sim rename to tests/script/tsim/table/delete_reuse2.sim diff --git a/tests/script/general/table/delete_writing.sim b/tests/script/tsim/table/delete_writing.sim similarity index 100% rename from tests/script/general/table/delete_writing.sim rename to tests/script/tsim/table/delete_writing.sim diff --git a/tests/script/general/table/describe.sim b/tests/script/tsim/table/describe.sim similarity index 100% rename from tests/script/general/table/describe.sim rename to tests/script/tsim/table/describe.sim diff --git a/tests/script/general/table/double.sim b/tests/script/tsim/table/double.sim similarity index 100% rename from tests/script/general/table/double.sim rename to tests/script/tsim/table/double.sim diff --git a/tests/script/general/table/float.sim b/tests/script/tsim/table/float.sim similarity index 100% rename from tests/script/general/table/float.sim rename to tests/script/tsim/table/float.sim diff --git a/tests/script/general/table/int.sim b/tests/script/tsim/table/int.sim similarity index 100% rename from tests/script/general/table/int.sim rename to tests/script/tsim/table/int.sim diff --git a/tests/script/general/table/limit.sim b/tests/script/tsim/table/limit.sim similarity index 100% rename from tests/script/general/table/limit.sim rename to tests/script/tsim/table/limit.sim diff --git a/tests/script/general/table/smallint.sim b/tests/script/tsim/table/smallint.sim similarity index 100% rename from tests/script/general/table/smallint.sim rename to tests/script/tsim/table/smallint.sim diff --git a/tests/script/general/table/table.sim b/tests/script/tsim/table/table.sim similarity index 100% rename from tests/script/general/table/table.sim rename to tests/script/tsim/table/table.sim diff --git a/tests/script/general/table/table_len.sim b/tests/script/tsim/table/table_len.sim similarity index 100% rename from tests/script/general/table/table_len.sim rename to tests/script/tsim/table/table_len.sim diff --git a/tests/script/general/table/testSuite.sim b/tests/script/tsim/table/testSuite.sim similarity index 100% rename from tests/script/general/table/testSuite.sim rename to tests/script/tsim/table/testSuite.sim diff --git a/tests/script/general/table/tinyint.sim b/tests/script/tsim/table/tinyint.sim similarity index 100% rename from tests/script/general/table/tinyint.sim rename to tests/script/tsim/table/tinyint.sim diff --git a/tests/script/general/table/vgroup.sim b/tests/script/tsim/table/vgroup.sim similarity index 100% rename from tests/script/general/table/vgroup.sim rename to tests/script/tsim/table/vgroup.sim From bfb2900c19c7cafeb395a6b877843a460578ecd5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 14 Jul 2022 15:24:48 +0800 Subject: [PATCH 5/6] test: restore some 2.0 case --- tests/script/tsim/table/autocreate.sim | 1 - tests/script/tsim/table/basic2.sim | 1 - tests/script/tsim/table/basic3.sim | 3 +-- tests/script/tsim/table/bigint.sim | 5 +---- tests/script/tsim/table/binary.sim | 5 +---- tests/script/tsim/table/bool.sim | 5 +---- tests/script/tsim/table/column2.sim | 5 +---- tests/script/tsim/table/column_name.sim | 5 +---- tests/script/tsim/table/column_num.sim | 5 +---- tests/script/tsim/table/column_value.sim | 5 +---- tests/script/tsim/table/createmulti.sim | 1 - tests/script/tsim/table/date.sim | 5 +---- tests/script/tsim/table/db.table.sim | 5 +---- tests/script/tsim/table/describe.sim | 5 +---- tests/script/tsim/table/double.sim | 5 +---- tests/script/tsim/table/float.sim | 5 +---- tests/script/tsim/table/int.sim | 5 +---- tests/script/tsim/table/limit.sim | 7 +----- tests/script/tsim/table/smallint.sim | 5 +---- tests/script/tsim/table/table.sim | 5 +---- tests/script/tsim/table/table_len.sim | 5 +---- tests/script/tsim/table/testSuite.sim | 27 ------------------------ tests/script/tsim/table/tinyint.sim | 5 +---- tests/script/tsim/table/vgroup.sim | 8 ++----- 24 files changed, 21 insertions(+), 112 deletions(-) delete mode 100644 tests/script/tsim/table/testSuite.sim diff --git a/tests/script/tsim/table/autocreate.sim b/tests/script/tsim/table/autocreate.sim index 404c714ab4..70d58483a2 100644 --- a/tests/script/tsim/table/autocreate.sim +++ b/tests/script/tsim/table/autocreate.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 2000 sql connect print =============== create database diff --git a/tests/script/tsim/table/basic2.sim b/tests/script/tsim/table/basic2.sim index 4286f9ee4a..737d5a3efe 100644 --- a/tests/script/tsim/table/basic2.sim +++ b/tests/script/tsim/table/basic2.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 2000 sql connect print =============== one table diff --git a/tests/script/tsim/table/basic3.sim b/tests/script/tsim/table/basic3.sim index 41c276ae98..21470affa8 100644 --- a/tests/script/tsim/table/basic3.sim +++ b/tests/script/tsim/table/basic3.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 2000 sql connect print =============== create database @@ -73,7 +72,7 @@ endi print =============== drop stable sql drop table db.st sql show db.stables -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/bigint.sim b/tests/script/tsim/table/bigint.sim index d75f406d77..4611db112f 100644 --- a/tests/script/tsim/table/bigint.sim +++ b/tests/script/tsim/table/bigint.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -66,7 +63,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/binary.sim b/tests/script/tsim/table/binary.sim index 47915530ef..a2cfc77796 100644 --- a/tests/script/tsim/table/binary.sim +++ b/tests/script/tsim/table/binary.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -56,7 +53,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/bool.sim b/tests/script/tsim/table/bool.sim index e49637448f..454bf47d33 100644 --- a/tests/script/tsim/table/bool.sim +++ b/tests/script/tsim/table/bool.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -85,7 +82,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/column2.sim b/tests/script/tsim/table/column2.sim index 441766f2d4..e540835c14 100644 --- a/tests/script/tsim/table/column2.sim +++ b/tests/script/tsim/table/column2.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print =============== step1 @@ -19,7 +16,7 @@ endi sql drop database db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/column_name.sim b/tests/script/tsim/table/column_name.sim index 47fcfab5a8..bad6c95bb1 100644 --- a/tests/script/tsim/table/column_name.sim +++ b/tests/script/tsim/table/column_name.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -79,7 +76,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/column_num.sim b/tests/script/tsim/table/column_num.sim index a18173bc8f..0a5d151adf 100644 --- a/tests/script/tsim/table/column_num.sim +++ b/tests/script/tsim/table/column_num.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -78,7 +75,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/column_value.sim b/tests/script/tsim/table/column_value.sim index 1edf8c2992..861e2f1a8d 100644 --- a/tests/script/tsim/table/column_value.sim +++ b/tests/script/tsim/table/column_value.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -68,7 +65,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/createmulti.sim b/tests/script/tsim/table/createmulti.sim index 0da1ce96a7..efdb276c94 100644 --- a/tests/script/tsim/table/createmulti.sim +++ b/tests/script/tsim/table/createmulti.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 3000 sql connect print =============== create database diff --git a/tests/script/tsim/table/date.sim b/tests/script/tsim/table/date.sim index 23188e12e0..218049d329 100644 --- a/tests/script/tsim/table/date.sim +++ b/tests/script/tsim/table/date.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -83,7 +80,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/db.table.sim b/tests/script/tsim/table/db.table.sim index 906396402a..b5d8294b6e 100644 --- a/tests/script/tsim/table/db.table.sim +++ b/tests/script/tsim/table/db.table.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -40,7 +37,7 @@ sql drop table $table sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/describe.sim b/tests/script/tsim/table/describe.sim index e59371e530..28690e5794 100644 --- a/tests/script/tsim/table/describe.sim +++ b/tests/script/tsim/table/describe.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -42,7 +39,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/double.sim b/tests/script/tsim/table/double.sim index ab3f2428bd..08f0dc7663 100644 --- a/tests/script/tsim/table/double.sim +++ b/tests/script/tsim/table/double.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -91,7 +88,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/float.sim b/tests/script/tsim/table/float.sim index 2d0ea0e5ea..c53b4bb1a4 100644 --- a/tests/script/tsim/table/float.sim +++ b/tests/script/tsim/table/float.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -91,7 +88,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/int.sim b/tests/script/tsim/table/int.sim index f30b5b28f5..f84858c7d0 100644 --- a/tests/script/tsim/table/int.sim +++ b/tests/script/tsim/table/int.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -127,7 +124,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/limit.sim b/tests/script/tsim/table/limit.sim index dd38453d0c..0a07ee3efa 100644 --- a/tests/script/tsim/table/limit.sim +++ b/tests/script/tsim/table/limit.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 129 -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 8 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ============================ dnode1 start @@ -87,7 +82,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/smallint.sim b/tests/script/tsim/table/smallint.sim index f622ce7853..c81681c316 100644 --- a/tests/script/tsim/table/smallint.sim +++ b/tests/script/tsim/table/smallint.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -98,7 +95,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/table.sim b/tests/script/tsim/table/table.sim index c9806c40c6..6a706c979f 100644 --- a/tests/script/tsim/table/table.sim +++ b/tests/script/tsim/table/table.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ============================ dnode1 start @@ -217,7 +214,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/table_len.sim b/tests/script/tsim/table/table_len.sim index d95c9ab0aa..e48c5d419e 100644 --- a/tests/script/tsim/table/table_len.sim +++ b/tests/script/tsim/table/table_len.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -98,7 +95,7 @@ step8: sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/testSuite.sim b/tests/script/tsim/table/testSuite.sim deleted file mode 100644 index d6cc88b36a..0000000000 --- a/tests/script/tsim/table/testSuite.sim +++ /dev/null @@ -1,27 +0,0 @@ -run general/table/autocreate.sim -run general/table/basic1.sim -run general/table/basic2.sim -run general/table/basic3.sim -run general/table/bigint.sim -run general/table/binary.sim -run general/table/bool.sim -run general/table/column_name.sim -run general/table/column_num.sim -run general/table/column_value.sim -run general/table/column2.sim -run general/table/date.sim -run general/table/db.table.sim -run general/table/delete_reuse1.sim -run general/table/delete_reuse2.sim -run general/table/delete_writing.sim -run general/table/describe.sim -run general/table/double.sim -run general/table/fill.sim -run general/table/float.sim -run general/table/int.sim -run general/table/limit.sim -run general/table/smallint.sim -run general/table/table_len.sim -run general/table/table.sim -run general/table/tinyint.sim -run general/table/vgroup.sim diff --git a/tests/script/tsim/table/tinyint.sim b/tests/script/tsim/table/tinyint.sim index afa931fc79..089fab0bfa 100644 --- a/tests/script/tsim/table/tinyint.sim +++ b/tests/script/tsim/table/tinyint.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -97,7 +94,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/table/vgroup.sim b/tests/script/tsim/table/vgroup.sim index d306a4731d..902415400e 100644 --- a/tests/script/tsim/table/vgroup.sim +++ b/tests/script/tsim/table/vgroup.sim @@ -1,12 +1,8 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 4 -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect + print ============================ dnode1 start $i = 0 @@ -144,7 +140,7 @@ while $i < 5 $i = $i + 1 endw sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi From 13230df94822b7da55387f889a694286f784cd2f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 14 Jul 2022 15:51:59 +0800 Subject: [PATCH 6/6] test: restore some 2.0 case --- tests/script/jenkins/basic.txt | 47 +++++++++--------- tests/script/tsim/table/autocreate.sim | 2 +- tests/script/tsim/table/basic1.sim | 17 ------- tests/script/tsim/table/basic2.sim | 6 +-- tests/script/tsim/table/basic3.sim | 4 +- tests/script/tsim/table/createmulti.sim | 2 +- tests/script/tsim/table/date.sim | 16 +++--- tests/script/tsim/table/int.sim | 66 ++++++++++++------------- tests/script/tsim/table/limit.sim | 4 +- tests/script/tsim/table/smallint.sim | 50 +++++++++---------- tests/script/tsim/table/table.sim | 5 +- tests/script/tsim/table/tinyint.sim | 36 +++++++------- tests/script/tsim/table/vgroup.sim | 24 ++++----- 13 files changed, 126 insertions(+), 153 deletions(-) diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 2c7170d40b..4de8b3667d 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -103,34 +103,33 @@ ./test.sh -f tsim/show/basic.sim # ---- table -# ./test.sh -f tsim/table/autocreate.sim +./test.sh -f tsim/table/autocreate.sim ./test.sh -f tsim/table/basic1.sim -# ./test.sh -f tsim/table/basic2.sim -# ./test.sh -f tsim/table/basic3.sim -# ./test.sh -f tsim/table/bigint.sim -# ./test.sh -f tsim/table/binary.sim -# ./test.sh -f tsim/table/bool.sim -# ./test.sh -f tsim/table/column_name.sim -# ./test.sh -f tsim/table/column_num.sim -# ./test.sh -f tsim/table/column_value.sim -# ./test.sh -f tsim/table/column2.sim -# ./test.sh -f tsim/table/createmulti.sim -# ./test.sh -f tsim/table/date.sim -# ./test.sh -f tsim/table/db.table.sim +./test.sh -f tsim/table/basic2.sim +./test.sh -f tsim/table/basic3.sim +./test.sh -f tsim/table/bigint.sim +./test.sh -f tsim/table/binary.sim +./test.sh -f tsim/table/bool.sim +./test.sh -f tsim/table/column_name.sim +./test.sh -f tsim/table/column_num.sim +./test.sh -f tsim/table/column_value.sim +./test.sh -f tsim/table/column2.sim +./test.sh -f tsim/table/createmulti.sim +./test.sh -f tsim/table/date.sim +./test.sh -f tsim/table/db.table.sim # ./test.sh -f tsim/table/delete_reuse1.sim # ./test.sh -f tsim/table/delete_reuse2.sim # ./test.sh -f tsim/table/delete_writing.sim -# ./test.sh -f tsim/table/describe.sim -# ./test.sh -f tsim/table/double.sim -# ./test.sh -f tsim/table/fill.sim -# ./test.sh -f tsim/table/float.sim -# ./test.sh -f tsim/table/int.sim -# ./test.sh -f tsim/table/limit.sim -# ./test.sh -f tsim/table/smallint.sim -# ./test.sh -f tsim/table/table_len.sim -# ./test.sh -f tsim/table/table.sim -# ./test.sh -f tsim/table/tinyint.sim -# ./test.sh -f tsim/table/vgroup.sim +./test.sh -f tsim/table/describe.sim +./test.sh -f tsim/table/double.sim +./test.sh -f tsim/table/float.sim +./test.sh -f tsim/table/int.sim +./test.sh -f tsim/table/limit.sim +./test.sh -f tsim/table/smallint.sim +./test.sh -f tsim/table/table_len.sim +./test.sh -f tsim/table/table.sim +./test.sh -f tsim/table/tinyint.sim +./test.sh -f tsim/table/vgroup.sim # ---- stream ./test.sh -f tsim/stream/basic0.sim diff --git a/tests/script/tsim/table/autocreate.sim b/tests/script/tsim/table/autocreate.sim index 70d58483a2..1267e33932 100644 --- a/tests/script/tsim/table/autocreate.sim +++ b/tests/script/tsim/table/autocreate.sim @@ -6,7 +6,7 @@ sql connect print =============== create database sql create database db sql show databases -if $rows != 1 then +if $rows != 3 then return -1 endi diff --git a/tests/script/tsim/table/basic1.sim b/tests/script/tsim/table/basic1.sim index 913ced74aa..6cb5bc54f7 100644 --- a/tests/script/tsim/table/basic1.sim +++ b/tests/script/tsim/table/basic1.sim @@ -213,23 +213,6 @@ endi system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - print =============== query data sql select * from c1 print rows: $rows diff --git a/tests/script/tsim/table/basic2.sim b/tests/script/tsim/table/basic2.sim index 737d5a3efe..297ae3d333 100644 --- a/tests/script/tsim/table/basic2.sim +++ b/tests/script/tsim/table/basic2.sim @@ -20,11 +20,11 @@ endi print =============== show sql show databases -if $data02 != 2 then +if $data22 != 2 then return -1 endi -if $data03 != 1 then +if $data24 != 1 then return -1 endi @@ -33,7 +33,7 @@ if $data00 != 2 then return -1 endi -if $data01 != 2 then +if $data01 != d1 then return -1 endi diff --git a/tests/script/tsim/table/basic3.sim b/tests/script/tsim/table/basic3.sim index 21470affa8..c9335b6d1b 100644 --- a/tests/script/tsim/table/basic3.sim +++ b/tests/script/tsim/table/basic3.sim @@ -6,7 +6,7 @@ sql connect print =============== create database sql create database db sql show databases -if $rows != 1 then +if $rows != 3 then return -1 endi @@ -72,7 +72,7 @@ endi print =============== drop stable sql drop table db.st sql show db.stables -if $rows != 2 then +if $rows != 0 then return -1 endi diff --git a/tests/script/tsim/table/createmulti.sim b/tests/script/tsim/table/createmulti.sim index efdb276c94..e204bd4f3d 100644 --- a/tests/script/tsim/table/createmulti.sim +++ b/tests/script/tsim/table/createmulti.sim @@ -6,7 +6,7 @@ sql connect print =============== create database sql create database db sql show databases -if $rows != 1 then +if $rows != 3 then return -1 endi diff --git a/tests/script/tsim/table/date.sim b/tests/script/tsim/table/date.sim index 218049d329..f2361cf4f5 100644 --- a/tests/script/tsim/table/date.sim +++ b/tests/script/tsim/table/date.sim @@ -24,18 +24,18 @@ if $data00 != @17-01-01 08:00:00.001@ then endi print =============== step2 -sql insert into $tb values ('2017-08-28 00:23:46.429+ 1a', 2) -#sql insert into $tb values ('2017-08-28 00:23:46cd .429', 2) +sql_error insert into $tb values ('2017-08-28 00:23:46.429+ 1a', 2) +sql_error insert into $tb values ('2017-08-28 00:23:46cd .429', 2) sql select ts from $tb -if $rows != 2 then +if $rows != 1 then return -1 endi print =============== step3 -#sql insert into $tb values ('1970-01-01 08:00:00.000', 3) -#sql insert into $tb values ('1970-01-01 08:00:00.000', 3) +sql_error insert into $tb values ('1970-01-01 08:00:00.000', 3) +sql_error insert into $tb values ('1970-01-01 08:00:00.000', 3) sql select ts from $tb -if $rows != 2 then +if $rows != 1 then return -1 endi @@ -54,7 +54,7 @@ print =============== step5 sql_error insert into $tb values ('9999-12-31 213:59:59.999', 13) sql select ts from $tb print $rows -if $rows != 8 then +if $rows != 7 then return -1 endi @@ -62,7 +62,7 @@ print =============== step6 sql_error insert into $tb values ('9999-12-99 23:59:59.999', 13) sql select ts from $tb -if $rows != 8 then +if $rows != 7 then return -1 endi diff --git a/tests/script/tsim/table/int.sim b/tests/script/tsim/table/int.sim index f84858c7d0..7e3cefc7ca 100644 --- a/tests/script/tsim/table/int.sim +++ b/tests/script/tsim/table/int.sim @@ -24,12 +24,10 @@ if $data01 != NULL then endi print =============== step2 -sql insert into $tb values (now+1m, -2147483648) -x step2 - return -1 -step2: -sql insert into $tb values (now+1m, NULL) +sql insert into $tb values (now+1m, -2147483648) +sql insert into $tb values (now+2m, NULL) sql select * from $tb order by ts desc -if $rows != 2 then +if $rows != 3 then return -1 endi if $data01 != NULL then @@ -37,9 +35,9 @@ if $data01 != NULL then endi print =============== step3 -sql insert into $tb values (now+2m, 2147483647) +sql insert into $tb values (now+3m, 2147483647) sql select * from $tb order by ts desc -if $rows != 3 then +if $rows != 4 then return -1 endi if $data01 != 2147483647 then @@ -47,12 +45,10 @@ if $data01 != 2147483647 then endi print =============== step4 -sql insert into $tb values (now+3m, 2147483648) -x step4 - return -1 -step4: -sql insert into $tb values (now+3m, NULL) +sql_error insert into $tb values (now+4m, 2147483648) +sql insert into $tb values (now+5m, NULL) sql select * from $tb order by ts desc -if $rows != 4 then +if $rows != 5 then return -1 endi if $data01 != NULL then @@ -60,10 +56,10 @@ if $data01 != NULL then endi print =============== step5 -sql_error insert into $tb values (now+4m, a2) -sql insert into $tb values (now+4m, 0) +sql_error insert into $tb values (now+6m, a2) +sql insert into $tb values (now+7m, 0) sql select * from $tb order by ts desc -if $rows != 5 then +if $rows != 6 then return -1 endi if $data01 != 0 then @@ -71,19 +67,8 @@ if $data01 != 0 then endi print =============== step6 -sql_error insert into $tb values (now+5m, 2a) -sql insert into $tb values (now+5m, 2) -sql select * from $tb order by ts desc -if $rows != 6 then - return -1 -endi -if $data01 != 2 then - return -1 -endi - -print =============== step7 -sql_error insert into $tb values (now+6m, 2a'1) -sql insert into $tb values (now+6m, 2) +sql_error insert into $tb values (now+8m, 2a) +sql insert into $tb values (now+9m, 2) sql select * from $tb order by ts desc if $rows != 7 then return -1 @@ -92,18 +77,19 @@ if $data01 != 2 then return -1 endi -print =============== step8 -sql insert into $tb values (now+8m, "NULL") +print =============== step7 +sql_error insert into $tb values (now+10m, 2a'1) +sql insert into $tb values (now+11m, 2) sql select * from $tb order by ts desc if $rows != 8 then return -1 endi -if $data01 != NULL then +if $data01 != 2 then return -1 endi -print =============== step9 -sql insert into $tb values (now+9m, 'NULL') +print =============== step8 +sql insert into $tb values (now+12m, "NULL") sql select * from $tb order by ts desc if $rows != 9 then return -1 @@ -112,12 +98,22 @@ if $data01 != NULL then return -1 endi -print =============== step10 -sql insert into $tb values (now+10m, -123) +print =============== step9 +sql insert into $tb values (now+13m, 'NULL') sql select * from $tb order by ts desc if $rows != 10 then return -1 endi +if $data01 != NULL then + return -1 +endi + +print =============== step10 +sql insert into $tb values (now+14m, -123) +sql select * from $tb order by ts desc +if $rows != 11 then + return -1 +endi if $data01 != -123 then return -1 endi diff --git a/tests/script/tsim/table/limit.sim b/tests/script/tsim/table/limit.sim index 0a07ee3efa..d20938367e 100644 --- a/tests/script/tsim/table/limit.sim +++ b/tests/script/tsim/table/limit.sim @@ -12,10 +12,10 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i print =================== step 0 -sql create database $db +sql create database $db vgroups 8 sql use $db sql show vgroups -if $rows != 0 then +if $rows != 8 then return -1 endi diff --git a/tests/script/tsim/table/smallint.sim b/tests/script/tsim/table/smallint.sim index c81681c316..87140c561a 100644 --- a/tests/script/tsim/table/smallint.sim +++ b/tests/script/tsim/table/smallint.sim @@ -25,12 +25,10 @@ if $data01 != NULL then endi print =============== step2 -sql insert into $tb values (now+1m, -32768) -x step2 - return -1 -step2: -sql insert into $tb values (now+1m, NULL) +sql insert into $tb values (now+1m, -32768) +sql insert into $tb values (now+2m, NULL) sql select * from $tb order by ts desc -if $rows != 2 then +if $rows != 3 then return -1 endi if $data01 != NULL then @@ -38,9 +36,9 @@ if $data01 != NULL then endi print =============== step3 -sql insert into $tb values (now+2m, 32767) +sql insert into $tb values (now+3m, 32767) sql select * from $tb order by ts desc -if $rows != 3 then +if $rows != 4 then return -1 endi if $data01 != 32767 then @@ -48,12 +46,12 @@ if $data01 != 32767 then endi print =============== step4 -sql insert into $tb values (now+3m, 32768) -x step4 +sql insert into $tb values (now+4m, 32768) -x step4 return -1 step4: -sql insert into $tb values (now+3m, NULL) +sql insert into $tb values (now+5m, NULL) sql select * from $tb order by ts desc -if $rows != 4 then +if $rows != 5 then return -1 endi if $data01 != NULL then @@ -61,10 +59,10 @@ if $data01 != NULL then endi print =============== step5 -sql_error insert into $tb values (now+4m, a2) -sql insert into $tb values (now+4m, 0) +sql_error insert into $tb values (now+6m, a2) +sql insert into $tb values (now+7m, 0) sql select * from $tb order by ts desc -if $rows != 5 then +if $rows != 6 then return -1 endi if $data01 != 0 then @@ -72,19 +70,8 @@ if $data01 != 0 then endi print =============== step6 -sql_error insert into $tb values (now+5m, 2a) -sql insert into $tb values (now+5m, 2) -sql select * from $tb order by ts desc -if $rows != 6 then - return -1 -endi -if $data01 != 2 then - return -1 -endi - -print =============== step7 -sql_error insert into $tb values (now+6m, 2a'1) -sql insert into $tb values (now+6m, 2) +sql_error insert into $tb values (now+8m, 2a) +sql insert into $tb values (now+9m, 2) sql select * from $tb order by ts desc if $rows != 7 then return -1 @@ -93,6 +80,17 @@ if $data01 != 2 then return -1 endi +print =============== step7 +sql_error insert into $tb values (now+10m, 2a'1) +sql insert into $tb values (now+11m, 2) +sql select * from $tb order by ts desc +if $rows != 8 then + return -1 +endi +if $data01 != 2 then + return -1 +endi +return sql drop database $db sql show databases if $rows != 2 then diff --git a/tests/script/tsim/table/table.sim b/tests/script/tsim/table/table.sim index 6a706c979f..65774dd03c 100644 --- a/tests/script/tsim/table/table.sim +++ b/tests/script/tsim/table/table.sim @@ -197,16 +197,15 @@ if $data01 != 7 then endi print =============== step10 -$i = 1 $tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val tinyint, val2 tinyint) +sql_error create table $tb (ts timestamp, val tinyint, val2 tinyint) sql show tables if $rows != 7 then return -1 endi print =============== step11 -sql create table $tb (ts timestamp, val float, val2 double) +sql_error create table $tb (ts timestamp, val float, val2 double) sql show tables if $rows != 7 then return -1 diff --git a/tests/script/tsim/table/tinyint.sim b/tests/script/tsim/table/tinyint.sim index 089fab0bfa..4764600b5b 100644 --- a/tests/script/tsim/table/tinyint.sim +++ b/tests/script/tsim/table/tinyint.sim @@ -24,12 +24,10 @@ if $data01 != NULL then endi print =============== step2 -sql insert into $tb values (now+1m, -128) -x step2 - return -1 -step2: -sql insert into $tb values (now+1m, NULL) +sql insert into $tb values (now+1m, -128) +sql insert into $tb values (now+2m, NULL) sql select * from $tb order by ts desc -if $rows != 2 then +if $rows != 3 then return -1 endi if $data01 != NULL then @@ -37,9 +35,9 @@ if $data01 != NULL then endi print =============== step3 -sql insert into $tb values (now+2m, 127) +sql insert into $tb values (now+3m, 127) sql select * from $tb order by ts desc -if $rows != 3 then +if $rows != 4 then return -1 endi if $data01 != 127 then @@ -47,12 +45,12 @@ if $data01 != 127 then endi print =============== step4 -sql insert into $tb values (now+3m, 128) -x step4 +sql insert into $tb values (now+4m, 128) -x step4 return -1 step4: -sql insert into $tb values (now+3m, NULL) +sql insert into $tb values (now+5m, NULL) sql select * from $tb -if $rows != 4 then +if $rows != 5 then return -1 endi if $data01 != NULL then @@ -60,10 +58,10 @@ if $data01 != NULL then endi print =============== step5 -sql_error insert into $tb values (now+4m, a2) -sql insert into $tb values (now+4m, 0) +sql_error insert into $tb values (now+6m, a2) +sql insert into $tb values (now+7m, 0) sql select * from $tb order by ts desc -if $rows != 5 then +if $rows != 6 then return -1 endi if $data01 != 0 then @@ -71,10 +69,10 @@ if $data01 != 0 then endi print =============== step6 -sql_error insert into $tb values (now+5m, 2a) -sql insert into $tb values (now+5m, 2) +sql_error insert into $tb values (now+8m, 2a) +sql insert into $tb values (now+9m, 2) sql select * from $tb order by ts desc -if $rows != 6 then +if $rows != 7 then return -1 endi if $data01 != 2 then @@ -82,10 +80,10 @@ if $data01 != 2 then endi print =============== step7 -sql_error insert into $tb values (now+6m, 2a'1) -sql insert into $tb values (now+6m, 2) +sql_error insert into $tb values (now+10m, 2a'1) +sql insert into $tb values (now+11m, 2) sql select * from $tb order by ts desc -if $rows != 7 then +if $rows != 8 then return -1 endi if $data01 != 2 then diff --git a/tests/script/tsim/table/vgroup.sim b/tests/script/tsim/table/vgroup.sim index 902415400e..2925e9de4c 100644 --- a/tests/script/tsim/table/vgroup.sim +++ b/tests/script/tsim/table/vgroup.sim @@ -12,10 +12,10 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i print =================== step 1 -sql create database $db +sql create database $db vgroups 4 sql use $db sql show vgroups -if $rows != 0 then +if $rows != 4 then return -1 endi @@ -24,7 +24,7 @@ sql create table table2 (ts timestamp, speed int) sql create table table3 (ts timestamp, speed int) sql create table table4 (ts timestamp, speed int) sql show vgroups -if $rows != 1 then +if $rows != 4 then return -1 endi @@ -33,7 +33,7 @@ sql create table table6 (ts timestamp, speed int) sql create table table7 (ts timestamp, speed int) sql create table table8 (ts timestamp, speed int) sql show vgroups -if $rows != 2 then +if $rows != 4 then return -1 endi @@ -42,7 +42,7 @@ sql create table table10 (ts timestamp, speed int) sql create table table11 (ts timestamp, speed int) sql create table table12 (ts timestamp, speed int) sql show vgroups -if $rows != 3 then +if $rows != 4 then return -1 endi @@ -54,7 +54,7 @@ endi sql drop table table13 sql show vgroups -if $rows != 3 then +if $rows != 4 then return -1 endi @@ -68,10 +68,10 @@ print =================== step 2 $i = 1 $db = $dbPrefix . $i -sql create database $db +sql create database $db vgroups 2 sql use $db sql show vgroups -if $rows != 0 then +if $rows != 2 then return -1 endi @@ -84,13 +84,13 @@ $db = $dbPrefix . $i sql use $db sql create table table2 (ts timestamp, speed int) sql show vgroups -if $rows != 1 then +if $rows != 2 then return -1 endi sql drop table table2 sql show vgroups -if $rows != 0 then +if $rows != 2 then return -1 endi @@ -100,7 +100,7 @@ sql create table table3 (ts timestamp, speed int) sql create table table4 (ts timestamp, speed int) sql drop table table1 sql show vgroups -if $rows != 1 then +if $rows != 2 then return -1 endi @@ -129,7 +129,7 @@ sql create database $db sql use $db sql show databases -if $rows != 5 then +if $rows != 7 then return -1 endi