summaryrefslogtreecommitdiffstats
path: root/tests/bugs/glusterd/bug-1483058-replace-brick-quorum-validation.t
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-11-09 22:42:22 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2017-11-30 06:48:06 +0000
commite5db48bf5780c1d278481e0dc25e5c64ccbf9583 (patch)
treef13202e96fe1558575c5d9f3f76b0bd0302abad0 /tests/bugs/glusterd/bug-1483058-replace-brick-quorum-validation.t
parent4c9478b3604305e0e20c90096198b14dda83e3d0 (diff)
tests: fix bug-1483058-replace-brick-quorum-validation.t spurious failure
> mainline patch : https://review.gluster.org/#/c/18710/ Change-Id: I04c35305bfb663eabbf715eee78695adfd4a2d20 BUG: 1512432 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> (cherry picked from commit 76a83f98b78a0bdf29bbb0f8e4c9ab74dae52be4)
Diffstat (limited to 'tests/bugs/glusterd/bug-1483058-replace-brick-quorum-validation.t')
-rw-r--r--tests/bugs/glusterd/bug-1483058-replace-brick-quorum-validation.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/bugs/glusterd/bug-1483058-replace-brick-quorum-validation.t b/tests/bugs/glusterd/bug-1483058-replace-brick-quorum-validation.t
index 3dbe28a7917..2d9e5287818 100644
--- a/tests/bugs/glusterd/bug-1483058-replace-brick-quorum-validation.t
+++ b/tests/bugs/glusterd/bug-1483058-replace-brick-quorum-validation.t
@@ -45,7 +45,14 @@ TEST start_glusterd 2
EXPECT_WITHIN $PROBE_TIMEOUT 2 peer_count
+# checking peer_count is not enough to call that quorum is regained as
+# peer_count is based on peerinfo->connected where as quorum is calculated based
+# on peerinfo->quorum_contrib. To avoid this spurious race of replace brick
+# commit force to execute and fail before the quorum is regained run the command
+# in EXPECT_WITHIN to ensure that with multiple attempts the command goes
+# through once the quorum is regained.
+
# Now quorum is met. replace-brick will execute successfuly
-TEST $CLI_1 volume replace-brick $V0 $H2:$B2/${V0}1 $H1:$B1/${V0}1_new commit force
+EXPECT_WITHIN $PEER_SYNC_TIMEOUT 0 attempt_replace_brick 1 $V0 $H2:$B2/${V0}1 $H1:$B1/${V0}1_new
#cleanup;