diff --git a/tests/common.sh b/tests/common.sh index ae66cf75..55feaeb2 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -53,12 +53,12 @@ start_etcd() for i in $(seq 1 $ETCD_COUNT); do start_etcd $i done -for i in {1..10}; do +for i in {1..30}; do ${ETCD}ctl --endpoints=$ETCD_URL --dial-timeout=1s --command-timeout=1s member list >/dev/null && break + if [[ $i = 30 ]]; then + format_error "Failed to start etcd" + fi done -if [[ $i = 10 ]]; then - format_error "Failed to start etcd" -fi echo leak:fio >> testdata/lsan-suppress.txt echo leak:tcmalloc >> testdata/lsan-suppress.txt diff --git a/tests/test_change_pg_count.sh b/tests/test_change_pg_count.sh index aa28067b..b5bab475 100755 --- a/tests/test_change_pg_count.sh +++ b/tests/test_change_pg_count.sh @@ -21,7 +21,7 @@ try_change() $ETCDCTL put /vitastor/config/pools '{"1":{'$POOLCFG',"pg_size":'$PG_SIZE',"pg_minsize":'$PG_MINSIZE',"pg_count":'$n'}}' - for i in {1..10}; do + for i in {1..60}; do ($ETCDCTL get /vitastor/config/pgs --print-value-only | jq -s -e '(.[0].items["1"] | map((.osd_set | select(. > 0)) | length == 2) | length) == '$n) && \ ($ETCDCTL get --prefix /vitastor/pg/state/ --print-value-only | jq -s -e '([ .[] | select(.state == ["active"] or .state == ["active", "has_misplaced"]) ] | length) == '$n'') && \ break diff --git a/tests/test_interrupted_rebalance.sh b/tests/test_interrupted_rebalance.sh index 8319266b..51b5ead1 100755 --- a/tests/test_interrupted_rebalance.sh +++ b/tests/test_interrupted_rebalance.sh @@ -30,6 +30,9 @@ try_reweight 4 1 try_reweight 5 1 +# Allow rebalance to start +sleep 5 + # Wait for the rebalance to finish wait_finish_rebalance 300