From d8b8112dbed6cac561c024f357e7815236e50479 Mon Sep 17 00:00:00 2001 From: liuyao <54liuyao@163.com> Date: Thu, 13 Jul 2023 17:29:30 +0800 Subject: [PATCH] op ci --- tests/script/tsim/stream/checkpoint0.sim | 99 +--------------------- tests/script/tsim/stream/checkpoint1.sim | 103 +++++++++++++++++++++++ 2 files changed, 107 insertions(+), 95 deletions(-) create mode 100644 tests/script/tsim/stream/checkpoint1.sim diff --git a/tests/script/tsim/stream/checkpoint0.sim b/tests/script/tsim/stream/checkpoint0.sim index 5e710be416..9b9198fda2 100644 --- a/tests/script/tsim/stream/checkpoint0.sim +++ b/tests/script/tsim/stream/checkpoint0.sim @@ -51,7 +51,7 @@ sleep 25000 print restart taosd 01 ...... -system sh/exec.sh -n dnode1 -s stop -x SIGINT +system sh/stop_dnodes.sh system sh/exec.sh -n dnode1 -s start @@ -126,10 +126,11 @@ if $data12 != 4 then goto loop2 endi +print step 2 print restart taosd 02 ...... -system sh/exec.sh -n dnode1 -s stop -x SIGINT +system sh/stop_dnodes.sh system sh/exec.sh -n dnode1 -s start @@ -172,98 +173,6 @@ if $data12 != 9 then goto loop20 endi -print step 2 - -sql create database test1 vgroups 4; - -sql use test1; - -sql create stable st(ts timestamp,a int,b int,c int, d double) tags(ta int,tb int,tc int); -sql create table t1 using st tags(1,1,1); -sql create table t2 using st tags(2,2,2); -sql create stream streams1 trigger at_once IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt1 as select _wstart, count(*) c1, sum(a) from st interval(10s); - -sql insert into t1 values(1648791213000,1,2,3,1.0); - -sql insert into t2 values(1648791213001,2,2,3,1.1); - -$loop_count = 0 - -loop2: -sleep 1000 - -sql select * from streamt1; - -$loop_count = $loop_count + 1 -if $loop_count == 10 then - return -1 -endi - -if $rows != 1 then - print =====rows=$rows expect 1 - goto loop2 -endi - -# row 0 -if $data01 != 2 then - print =====data01=$data01 - goto loop2 -endi - -if $data02 != 3 then - print =====data02=$data02 - goto loop2 -endi - -print waiting for checkpoint generation 2 ...... - -sleep 25000 - -print restart taosd - -system sh/exec.sh -n dnode1 -s stop -x SIGINT - -system sh/exec.sh -n dnode1 -s start - -sql insert into t1 values(1648791213002,3,2,3,1.1); - -$loop_count = 0 - -loop3: -sleep 1000 - -sql select * from streamt1; - -$loop_count = $loop_count + 1 -if $loop_count == 10 then - return -1 -endi - -if $rows != 2 then - print =====rows=$rows expect 2 - goto loop3 -endi - -# row 0 -if $data01 != 3 then - print =====data01=$data01 - goto loop3 -endi - -if $data02 != 6 then - print =====data02=$data02 - goto loop3 -endi - -# row 1 -if $data11 != 1 then - print =====data11=$data11 - goto loop3 -endi - -if $data12 != 4 then - print =====data12=$data12 - goto loop3 -endi +print end--------------------------------- system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/tsim/stream/checkpoint1.sim b/tests/script/tsim/stream/checkpoint1.sim new file mode 100644 index 0000000000..a339a1ad35 --- /dev/null +++ b/tests/script/tsim/stream/checkpoint1.sim @@ -0,0 +1,103 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 -v debugFlag 135 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print step 1 + +sql create database test vgroups 4; + +sql use test; + +sql create stable st(ts timestamp,a int,b int,c int, d double) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); +sql create stream streams0 trigger at_once IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt as select _wstart, count(*) c1, sum(a) from st interval(10s); + +sql insert into t1 values(1648791213000,1,2,3,1.0); + +sql insert into t2 values(1648791213001,2,2,3,1.1); + +$loop_count = 0 + +loop0: +sleep 1000 + +sql select * from streamt; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 1 then + print =====rows=$rows expect 1 + goto loop0 +endi + +# row 0 +if $data01 != 2 then + print =====data01=$data01 + goto loop0 +endi + +if $data02 != 3 then + print =====data02=$data02 + goto loop0 +endi + +print waiting for checkpoint generation 1 ...... + +sleep 25000 + +print restart taosd + +system sh/stop_dnodes.sh + +system sh/exec.sh -n dnode1 -s start + +sql insert into t1 values(1648791213002,3,2,3,1.1); + +$loop_count = 0 + +loop1: +sleep 1000 + +sql select * from streamt; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 2 then + print =====rows=$rows expect 2 + goto loop1 +endi + +# row 0 +if $data01 != 3 then + print =====data01=$data01 + goto loop1 +endi + +if $data02 != 6 then + print =====data02=$data02 + goto loop1 +endi + +# row 1 +if $data11 != 1 then + print =====data11=$data11 + goto loop1 +endi + +if $data12 != 4 then + print =====data12=$data12 + goto loop1 +endi + +print end--------------------------------- + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file