test(stream): add test cases.
This commit is contained in:
parent
ec71572d74
commit
05e9032fb9
|
@ -18,7 +18,47 @@ sql create stable st(ts timestamp, a int) tags(t int);
|
||||||
sql create table tu1 using st tags(1);
|
sql create table tu1 using st tags(1);
|
||||||
|
|
||||||
sql create stream stream1 trigger force_window_close into str_dst as select _wstart, count(*) from st partition by tbname interval(5s);
|
sql create stream stream1 trigger force_window_close into str_dst as select _wstart, count(*) from st partition by tbname interval(5s);
|
||||||
|
run tsim/stream/checkTaskStatus.sim
|
||||||
|
|
||||||
|
sql insert into tu1 values(now, 1);
|
||||||
|
sleep 5500
|
||||||
|
|
||||||
|
sql pause stream stream1
|
||||||
|
|
||||||
|
$loop_count = 0
|
||||||
|
|
||||||
|
loop1:
|
||||||
|
sleep 500
|
||||||
|
$loop_count = $loop_count + 1
|
||||||
|
if $loop_count == 20 then
|
||||||
|
goto end_loop1
|
||||||
|
endi
|
||||||
|
|
||||||
|
sql insert into tu1 values(now, 1);
|
||||||
|
goto loop1
|
||||||
|
|
||||||
|
end_loop1:
|
||||||
|
sql resume stream stream1
|
||||||
|
sleep 5000
|
||||||
|
|
||||||
|
sql select * from str_dst
|
||||||
|
|
||||||
|
if $rows != 4 then
|
||||||
|
print expect 4, actual: $rows
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
sql drop database test
|
||||||
|
|
||||||
|
print ============ test on micro precision db
|
||||||
|
print ============ create db
|
||||||
|
sql create database test vgroups 2 precision 'us';
|
||||||
|
|
||||||
|
sql use test
|
||||||
|
sql create stable st(ts timestamp, a int) tags(t int);
|
||||||
|
sql create table tu1 using st tags(1);
|
||||||
|
|
||||||
|
sql create stream stream1 trigger force_window_close into str_dst as select _wstart, count(*) from st partition by tbname interval(5s);
|
||||||
run tsim/stream/checkTaskStatus.sim
|
run tsim/stream/checkTaskStatus.sim
|
||||||
|
|
||||||
sql insert into tu1 values(now, 1);
|
sql insert into tu1 values(now, 1);
|
||||||
|
@ -41,10 +81,13 @@ goto loop0
|
||||||
end_loop:
|
end_loop:
|
||||||
|
|
||||||
sql resume stream stream1
|
sql resume stream stream1
|
||||||
|
sleep 5000
|
||||||
|
|
||||||
sql select * from str_dst
|
sql select * from str_dst
|
||||||
|
|
||||||
if $rows != 3 then
|
if $rows != 4 then
|
||||||
print expect 3, actual: $rows
|
print expect 4, actual: $rows
|
||||||
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
Loading…
Reference in New Issue