From 49d9c7d664763b18937050c04360e68919c25df9 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Tue, 25 Feb 2020 15:32:58 -0800 Subject: [PATCH] test: Expect being off by up to 2 and make sure all PGs are active+clean Fixes: https://tracker.ceph.com/issues/44296 Signed-off-by: David Zafman --- qa/standalone/mgr/balancer.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/qa/standalone/mgr/balancer.sh b/qa/standalone/mgr/balancer.sh index 7e87cbf4a5f36..28db7038588e6 100755 --- a/qa/standalone/mgr/balancer.sh +++ b/qa/standalone/mgr/balancer.sh @@ -163,7 +163,8 @@ function TEST_balancer2() { done test $OK = "yes" || return 1 # Plan is found, but PGs still need to move - sleep 30 + sleep 10 + wait_for_clean || return 1 ceph osd df PGS=$(ceph osd df --format=json-pretty | jq '.nodes[0].pgs') @@ -193,13 +194,14 @@ function TEST_balancer2() { done test $OK = "yes" || return 1 # Plan is found, but PGs still need to move - sleep 30 + sleep 10 + wait_for_clean || return 1 ceph osd df - # We should be with plue or minus 1 of FINAL_PER_OSD2 + # We should be with plus or minus 2 of FINAL_PER_OSD2 # This is because here each pool is balanced independently - MIN=$(expr $FINAL_PER_OSD2 - 1) - MAX=$(expr $FINAL_PER_OSD2 + 1) + MIN=$(expr $FINAL_PER_OSD2 - 2) + MAX=$(expr $FINAL_PER_OSD2 + 2) PGS=$(ceph osd df --format=json-pretty | jq '.nodes[0].pgs') test $PGS -ge $MIN -a $PGS -le $MAX || return 1 PGS=$(ceph osd df --format=json-pretty | jq '.nodes[1].pgs') -- 2.39.5