test: add test cases.

This commit is contained in:
Haojun Liao 2024-11-28 16:57:11 +08:00
parent 05e9032fb9
commit 6580e7751f
1 changed files with 53 additions and 8 deletions

View File

@ -4,7 +4,7 @@ system sh/exec.sh -n dnode1 -s start
sleep 50
sql connect
print =============== create database
print ========================================== create database
sql create database test vgroups 2;
sql select * from information_schema.ins_databases
if $rows != 3 then
@ -41,16 +41,16 @@ end_loop1:
sql resume stream stream1
sleep 5000
sql select * from str_dst
sql select sum(`count(*)`) from (select * from str_dst)
if $rows != 4 then
print expect 4, actual: $rows
if $data00 != 20 then
print expect 20, actual: $data00
return -1
endi
sql drop database test
print ============ test on micro precision db
print ===================================== micro precision db test
print ============ create db
sql create database test vgroups 2 precision 'us';
@ -83,10 +83,55 @@ end_loop:
sql resume stream stream1
sleep 5000
sql select * from str_dst
sql select sum(`count(*)`) from (select * from str_dst)
if $rows != 4 then
print expect 4, actual: $rows
if $data00 != 20 then
print expect 20, actual: $data00
return -1
endi
sql drop stream stream1
sql drop table str_dst
print ============================= too long watermark test
sql drop table tu1;
sql create table tu1 using st tags(1);
sql create stream stream2 trigger force_window_close watermark 30s into str_dst as select _wstart, count(*), now() from st partition by tbname interval(5s);
run tsim/stream/checkTaskStatus.sim
$loop_count = 0
loop2:
sleep 500
$loop_count = $loop_count + 1
if $loop_count == 20 then
goto end_loop3
endi
sql insert into tu1 values(now, 1);
goto loop2
end_loop3:
sql select count(*) from str_dst
print =================rows: $data00
if $data00 != 0 then
print expect 0, actual $data00
return -1
endi
sleep 35000
sql select sum(`count(*)`) from (select * from str_dst)
if $data00 != 19 then
print expect 19, actual: $data00
return -1
endi
sql select round(timediff(`now()`, `_wstart`)/1000000) from str_dst;
if $data00 != 35.000000000 then
print expect 35.000000000 , actual $data00
return -1
endi