From 264c7496c875914fcaf8bded44d61e284633c719 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 22 Jul 2016 07:48:27 +0530 Subject: tests: Fix spurious failures with split-brain-favorite-child-policy.t Problem: It is not guranteed that the self-heal daemon would apply the new option as soon as volume set is executed because all the command gurantees is that the process is notified of the change in volfile. Shd still needs to fetch volfile and reconfigure. If the next volume heal command comes even before the reconfigure happens, then the heal won't happen. Fix: Restart shd to make sure it has the option loaded with new value. >BUG: 1358976 >Change-Id: I3ed30ebbec17bd06caa632e79e9412564f431b19 >Signed-off-by: Pranith Kumar K >Reviewed-on: http://review.gluster.org/14978 >Smoke: Gluster Build System >Reviewed-by: Krutika Dhananjay >Tested-by: Jeff Darcy >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: Jeff Darcy BUG: 1360573 Change-Id: I09e097dbdc2cae659ad1617d336945eb804b09a5 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/15022 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Ravishankar N --- tests/basic/afr/split-brain-favorite-child-policy.t | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/basic/afr/split-brain-favorite-child-policy.t b/tests/basic/afr/split-brain-favorite-child-policy.t index 66fcd67a031..7a14852685c 100644 --- a/tests/basic/afr/split-brain-favorite-child-policy.t +++ b/tests/basic/afr/split-brain-favorite-child-policy.t @@ -45,6 +45,10 @@ EXPECT "1" echo $? #We know that the first brick has latest ctime. LATEST_CTIME_MD5=$(md5sum $B0/${V0}0/file | cut -d\ -f1) TEST $CLI volume set $V0 cluster.favorite-child-policy ctime +TEST $CLI volume start $V0 force +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1 TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0 cat $M0/file > /dev/null @@ -79,6 +83,10 @@ EXPECT "1" echo $? #We know that the second brick has latest mtime. LATEST_CTIME_MD5=$(md5sum $B0/${V0}1/file | cut -d\ -f1) TEST $CLI volume set $V0 cluster.favorite-child-policy mtime +TEST $CLI volume start $V0 force +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1 TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0 cat $M0/file > /dev/null @@ -113,6 +121,10 @@ EXPECT "1" echo $? #We know that the second brick has the bigger size file. BIGGER_FILE_MD5=$(md5sum $B0/${V0}1/file | cut -d\ -f1) TEST $CLI volume set $V0 cluster.favorite-child-policy size +TEST $CLI volume start $V0 force +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1 TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0 cat $M0/file > /dev/null @@ -164,6 +176,11 @@ EXPECT "1" echo $? #We know that the second and third bricks agree with each other. Pick any one of them. MAJORITY_MD5=$(md5sum $B0/${V0}1/file | cut -d\ -f1) TEST $CLI volume set $V0 cluster.favorite-child-policy majority +TEST $CLI volume start $V0 force +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 2 TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0 cat $M0/file > /dev/null -- cgit