@@ -61,25 +61,25 @@ response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-
6161create_table_query_id=$( echo $response | jq -r ' .id' )
6262echo " Create Table Query ID: $create_table_query_id "
6363
64- response1=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_1 SCHEDULE = 1 SECOND AS insert into t1 values(0)\" }" )
64+ response1=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_1 SCHEDULE = 5 SECOND AS insert into t1 values(0)\" }" )
6565create_task_1_query_id=$( echo $response1 | jq -r ' .id' )
6666echo " Create Task 1 Query ID: $create_task_1_query_id "
6767
68- response2=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_2 SCHEDULE = 5 SECOND AS insert into t1 values(1)\" }" )
68+ response2=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_2 SCHEDULE = 25 SECOND AS insert into t1 values(1)\" }" )
6969create_task_2_query_id=$( echo $response2 | jq -r ' .id' )
7070echo " Create Task 2 ID: $create_task_2_query_id "
7171
7272response3=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_3 AFTER 'my_task_1', 'my_task_2' AS insert into t1 values(2)\" }" )
7373create_task_3_query_id=$( echo $response3 | jq -r ' .id' )
7474echo " Create Task 3 ID: $create_task_3_query_id "
7575
76- sleep 1
76+ sleep 5
7777
7878response4=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" ALTER TASK my_task_3 RESUME\" }" )
7979alter_task_3_query_id=$( echo $response4 | jq -r ' .id' )
8080echo " Resume Task 3 ID: $alter_task_3_query_id "
8181
82- sleep 1
82+ sleep 5
8383
8484# Check Task Afters 1
8585
@@ -91,7 +91,7 @@ response6=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content
9191execute_task_2_query_id=$( echo $response6 | jq -r ' .id' )
9292echo " Execute Task 2 ID: $execute_task_2_query_id "
9393
94- sleep 5
94+ sleep 25
9595
9696response7=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t1 ORDER BY c1\" }" )
9797
@@ -113,7 +113,7 @@ response5=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content
113113execute_task_1_query_id=$( echo $response5 | jq -r ' .id' )
114114echo " Execute Task 1 ID: $execute_task_1_query_id "
115115
116- sleep 5
116+ sleep 25
117117
118118response7=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t1 ORDER BY c1\" }" )
119119
@@ -133,7 +133,7 @@ response8=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content
133133alter_task_2_query_id=$( echo $response8 | jq -r ' .id' )
134134echo " Resume Task 2 ID: $alter_task_2_query_id "
135135
136- sleep 8
136+ sleep 40
137137
138138response9=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t1 ORDER BY c1\" }" )
139139
@@ -167,7 +167,7 @@ python3 scripts/ci/wait_tcp.py --timeout 30 --port 9092
167167
168168echo " Started 2-node cluster with private task enabled..."
169169
170- sleep 9
170+ sleep 45
171171
172172response9=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t1 ORDER BY c1\" }" )
173173
@@ -234,22 +234,22 @@ response15=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
234234create_table_query_id_1=$( echo $response15 | jq -r ' .id' )
235235echo " Create Table Query ID: $create_table_query_id_1 "
236236
237- response16=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_4 SCHEDULE = USING CRON '*/5 * * * * ? ' AS insert into t2 values(0)\" }" )
237+ response16=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_4 SCHEDULE = USING CRON '*/25 * * * * * ' AS insert into t2 values(0)\" }" )
238238create_task_4_query_id=$( echo $response16 | jq -r ' .id' )
239239echo " Create Task 4 Query ID: $create_task_4_query_id "
240240
241- sleep 1
241+ sleep 5
242242
243243response17=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" ALTER TASK my_task_4 RESUME\" }" )
244244alter_task_4_query_id=$( echo $response17 | jq -r ' .id' )
245245echo " Resume Task 4 ID: $alter_task_4_query_id "
246246
247- sleep 11
247+ sleep 60
248248
249249response18=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t2 ORDER BY c1\" }" )
250250
251251actual=$( echo " $response18 " | jq -c ' .data' )
252- expected=' [["0"],["0"]]'
252+ expected=' [["0"],["0"],["0"] ]'
253253
254254if [ " $actual " = " $expected " ]; then
255255 echo " ✅ Query result matches expected"
@@ -274,19 +274,19 @@ response20=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
274274create_table_query_id_2=$( echo $response20 | jq -r ' .id' )
275275echo " Create Table Query ID: $create_table_query_id_2 "
276276
277- response21=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_5 SCHEDULE = 3 SECOND WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 1) AS insert into t3 values(1, 0)\" }" )
277+ response21=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_5 SCHEDULE = 25 SECOND WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 1) AS insert into t3 values(1, 0)\" }" )
278278create_task_5_query_id=$( echo $response21 | jq -r ' .id' )
279279echo " Create Task 5 Query ID: $create_task_5_query_id "
280280
281- response22=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_6 SCHEDULE = 5 SECOND WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 1) AS insert into t3 values(2, 0)\" }" )
281+ response22=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_6 SCHEDULE = 25 SECOND WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 1) AS insert into t3 values(2, 0)\" }" )
282282create_task_6_query_id=$( echo $response22 | jq -r ' .id' )
283283echo " Create Task 6 Query ID: $create_task_6_query_id "
284284
285285response23=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" CREATE TASK my_task_7 AFTER 'my_task_5', 'my_task_6' WHEN EXISTS (SELECT 1 FROM t3 WHERE c2 = 2) AS insert into t3 values(3, 0)\" }" )
286286create_task_7_query_id=$( echo $response23 | jq -r ' .id' )
287287echo " Create Task 7 Query ID: $create_task_7_query_id "
288288
289- sleep 1
289+ sleep 5
290290
291291response24=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" ALTER TASK my_task_5 RESUME\" }" )
292292alter_task_5_query_id=$( echo $response24 | jq -r ' .id' )
@@ -300,7 +300,7 @@ response26=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
300300alter_task_7_query_id=$( echo $response26 | jq -r ' .id' )
301301echo " Resume Task 7 ID: $alter_task_7_query_id "
302302
303- sleep 6
303+ sleep 30
304304
305305response27=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t3 ORDER BY c1\" }" )
306306
@@ -320,7 +320,7 @@ response28=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
320320insert_t3_query_id=$( echo $response28 | jq -r ' .id' )
321321echo " INSERT T3 (1, 1) ID: $insert_t3_query_id "
322322
323- sleep 5
323+ sleep 25
324324
325325response29=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1, c2 FROM t3 ORDER BY c1, c2\" }" )
326326
@@ -340,7 +340,7 @@ response30=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
340340execute_task_7_query_id=$( echo $response30 | jq -r ' .id' )
341341echo " Execute Task 7 ID: $execute_task_7_query_id "
342342
343- sleep 1
343+ sleep 5
344344
345345response31=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1, c2 FROM t3 ORDER BY c1, c2\" }" )
346346
@@ -360,12 +360,12 @@ response32=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
360360insert_t3_query_id_1=$( echo $response32 | jq -r ' .id' )
361361echo " INSERT T3 (2, 2) ID: $insert_t3_query_id_1 "
362362
363- sleep 6
363+ sleep 30
364364
365365response33=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1, c2 FROM t3 ORDER BY c1, c2\" }" )
366366
367367actual=$( echo " $response33 " | jq -c ' .data' )
368- expected=' [["1","0"],["1","0"],["1","0"],["1","1" ],["2","0"],["2","0"],["2","2"],["3","0 "],["3","0"],["3","0"]]'
368+ expected=' [["1","0"],["1","0"],["1","1" ],["2","0"],["2","0"],["2","2"],["3","0"],["3","0"]]'
369369
370370if [ " $actual " = " $expected " ]; then
371371 echo " ✅ Query result matches expected"
0 commit comments