Skip to content

Commit 49d2be1

Browse files
committed
tests: sync lib files with private
1 parent 68dc18d commit 49d2be1

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

tests/queries/0_stateless/mergetree_mutations.lib

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,16 @@ function wait_for_mutation()
77
local database=$3
88
database=${database:="${CLICKHOUSE_DATABASE}"}
99

10-
local i
11-
for i in {1..100}
10+
for _ in {1..300}
1211
do
1312
sleep 0.1
1413
if [[ $(${CLICKHOUSE_CLIENT} --query="SELECT min(is_done) FROM system.mutations WHERE database='$database' AND table='$table' AND mutation_id='$mutation_id'") -eq 1 ]]; then
15-
break
14+
return
1615
fi
17-
18-
if [[ $i -eq 100 ]]; then
19-
echo "Timed out while waiting for mutation to execute!"
20-
fi
21-
2216
done
17+
18+
echo "Timed out while waiting for mutation to execute!"
19+
${CLICKHOUSE_CLIENT} -q "SELECT * FROM system.mutations WHERE database='$database' AND table like '$table' AND mutation_id='$mutation_id' AND is_done=0"
2320
}
2421

2522
function wait_for_all_mutations()
@@ -28,20 +25,16 @@ function wait_for_all_mutations()
2825
local database=$2
2926
database=${database:="${CLICKHOUSE_DATABASE}"}
3027

31-
local i
32-
for i in {1..200}
28+
for _ in {1..600}
3329
do
3430
if [[ $(${CLICKHOUSE_CLIENT} --query="SELECT coalesce(minOrNull(is_done), 1) FROM system.mutations WHERE database='$database' AND table like '$table'") -eq 1 ]]; then
35-
break
31+
return
3632
fi
37-
38-
if [[ $i -eq 200 ]]; then
39-
echo "Timed out while waiting for mutation to execute!"
40-
${CLICKHOUSE_CLIENT} -q "SELECT * FROM system.mutations WHERE database='$database' AND table like '$table' AND is_done=0"
41-
fi
42-
4333
sleep 0.3
4434
done
35+
36+
echo "Timed out while waiting for mutation to execute!"
37+
${CLICKHOUSE_CLIENT} -q "SELECT * FROM system.mutations WHERE database='$database' AND table like '$table' AND is_done=0"
4538
}
4639

4740
# vi: ft=bash

tests/queries/0_stateless/replication.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function try_sync_replicas()
1717
WHERE (database = currentDatabase()) AND (table LIKE '$table_name_prefix%')
1818
))")
1919
local tables_arr
20-
readarray -t tables_arr < <(${CLICKHOUSE_CLIENT} -q "SELECT name FROM system.tables WHERE database=currentDatabase() AND name like '$table_name_prefix%' AND engine like '%Replicated%'")
20+
readarray -t tables_arr < <(${CLICKHOUSE_CLIENT} -q "SELECT name FROM system.tables WHERE database=currentDatabase() AND name like '$table_name_prefix%' AND (engine like '%Replicated%' or engine like '%Shared%')")
2121

2222
local t
2323
for t in "${tables_arr[@]}"

0 commit comments

Comments
 (0)