@@ -61,25 +61,25 @@ response=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content-
61
61
create_table_query_id=$( echo $response | jq -r ' .id' )
62
62
echo " Create Table Query ID: $create_table_query_id "
63
63
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)\" }" )
65
65
create_task_1_query_id=$( echo $response1 | jq -r ' .id' )
66
66
echo " Create Task 1 Query ID: $create_task_1_query_id "
67
67
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)\" }" )
69
69
create_task_2_query_id=$( echo $response2 | jq -r ' .id' )
70
70
echo " Create Task 2 ID: $create_task_2_query_id "
71
71
72
72
response3=$( 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)\" }" )
73
73
create_task_3_query_id=$( echo $response3 | jq -r ' .id' )
74
74
echo " Create Task 3 ID: $create_task_3_query_id "
75
75
76
- sleep 1
76
+ sleep 5
77
77
78
78
response4=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" ALTER TASK my_task_3 RESUME\" }" )
79
79
alter_task_3_query_id=$( echo $response4 | jq -r ' .id' )
80
80
echo " Resume Task 3 ID: $alter_task_3_query_id "
81
81
82
- sleep 1
82
+ sleep 5
83
83
84
84
# Check Task Afters 1
85
85
@@ -91,7 +91,7 @@ response6=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content
91
91
execute_task_2_query_id=$( echo $response6 | jq -r ' .id' )
92
92
echo " Execute Task 2 ID: $execute_task_2_query_id "
93
93
94
- sleep 5
94
+ sleep 25
95
95
96
96
response7=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t1 ORDER BY c1\" }" )
97
97
@@ -113,7 +113,7 @@ response5=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content
113
113
execute_task_1_query_id=$( echo $response5 | jq -r ' .id' )
114
114
echo " Execute Task 1 ID: $execute_task_1_query_id "
115
115
116
- sleep 5
116
+ sleep 25
117
117
118
118
response7=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t1 ORDER BY c1\" }" )
119
119
@@ -133,7 +133,7 @@ response8=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Content
133
133
alter_task_2_query_id=$( echo $response8 | jq -r ' .id' )
134
134
echo " Resume Task 2 ID: $alter_task_2_query_id "
135
135
136
- sleep 8
136
+ sleep 40
137
137
138
138
response9=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t1 ORDER BY c1\" }" )
139
139
@@ -167,7 +167,7 @@ python3 scripts/ci/wait_tcp.py --timeout 30 --port 9092
167
167
168
168
echo " Started 2-node cluster with private task enabled..."
169
169
170
- sleep 9
170
+ sleep 45
171
171
172
172
response9=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t1 ORDER BY c1\" }" )
173
173
@@ -234,22 +234,22 @@ response15=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
234
234
create_table_query_id_1=$( echo $response15 | jq -r ' .id' )
235
235
echo " Create Table Query ID: $create_table_query_id_1 "
236
236
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)\" }" )
238
238
create_task_4_query_id=$( echo $response16 | jq -r ' .id' )
239
239
echo " Create Task 4 Query ID: $create_task_4_query_id "
240
240
241
- sleep 1
241
+ sleep 5
242
242
243
243
response17=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" ALTER TASK my_task_4 RESUME\" }" )
244
244
alter_task_4_query_id=$( echo $response17 | jq -r ' .id' )
245
245
echo " Resume Task 4 ID: $alter_task_4_query_id "
246
246
247
- sleep 11
247
+ sleep 60
248
248
249
249
response18=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t2 ORDER BY c1\" }" )
250
250
251
251
actual=$( echo " $response18 " | jq -c ' .data' )
252
- expected=' [["0"],["0"]]'
252
+ expected=' [["0"],["0"],["0"] ]'
253
253
254
254
if [ " $actual " = " $expected " ]; then
255
255
echo " ✅ Query result matches expected"
@@ -274,19 +274,19 @@ response20=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
274
274
create_table_query_id_2=$( echo $response20 | jq -r ' .id' )
275
275
echo " Create Table Query ID: $create_table_query_id_2 "
276
276
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)\" }" )
278
278
create_task_5_query_id=$( echo $response21 | jq -r ' .id' )
279
279
echo " Create Task 5 Query ID: $create_task_5_query_id "
280
280
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)\" }" )
282
282
create_task_6_query_id=$( echo $response22 | jq -r ' .id' )
283
283
echo " Create Task 6 Query ID: $create_task_6_query_id "
284
284
285
285
response23=$( 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)\" }" )
286
286
create_task_7_query_id=$( echo $response23 | jq -r ' .id' )
287
287
echo " Create Task 7 Query ID: $create_task_7_query_id "
288
288
289
- sleep 1
289
+ sleep 5
290
290
291
291
response24=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" ALTER TASK my_task_5 RESUME\" }" )
292
292
alter_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
300
300
alter_task_7_query_id=$( echo $response26 | jq -r ' .id' )
301
301
echo " Resume Task 7 ID: $alter_task_7_query_id "
302
302
303
- sleep 6
303
+ sleep 30
304
304
305
305
response27=$( curl -s -u root: -XPOST " http://localhost:8000/v1/query" -H ' Content-Type: application/json' -d " {\" sql\" : \" SELECT c1 FROM t3 ORDER BY c1\" }" )
306
306
@@ -320,7 +320,7 @@ response28=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
320
320
insert_t3_query_id=$( echo $response28 | jq -r ' .id' )
321
321
echo " INSERT T3 (1, 1) ID: $insert_t3_query_id "
322
322
323
- sleep 5
323
+ sleep 25
324
324
325
325
response29=$( 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\" }" )
326
326
@@ -340,7 +340,7 @@ response30=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
340
340
execute_task_7_query_id=$( echo $response30 | jq -r ' .id' )
341
341
echo " Execute Task 7 ID: $execute_task_7_query_id "
342
342
343
- sleep 1
343
+ sleep 5
344
344
345
345
response31=$( 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\" }" )
346
346
@@ -360,12 +360,12 @@ response32=$(curl -s -u root: -XPOST "http://localhost:8000/v1/query" -H 'Conten
360
360
insert_t3_query_id_1=$( echo $response32 | jq -r ' .id' )
361
361
echo " INSERT T3 (2, 2) ID: $insert_t3_query_id_1 "
362
362
363
- sleep 6
363
+ sleep 30
364
364
365
365
response33=$( 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\" }" )
366
366
367
367
actual=$( 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"]]'
369
369
370
370
if [ " $actual " = " $expected " ]; then
371
371
echo " ✅ Query result matches expected"
0 commit comments