From 4adfb6fb7c371c6bc03acdaf61f1cca496388356 Mon Sep 17 00:00:00 2001 From: Shyam Date: Tue, 2 Sep 2014 12:37:07 -0400 Subject: cluster/dht: Modified test case to note rename failures as errors The bug referenced in this change, had an race condition that is now fixed by the following commits that are posted for review. http://review.gluster.org/#/c/8563/ http://review.gluster.org/#/c/8570/ These changes would now make the winning client not fail a rename, in case it failed to rename the linkto file. Hence when one client wins the link race, and the other still deletes the linkto file, the rename failure by the winning client is not a critical failure, hence it resolves the issue posted in the bug. As a result modifying the test case to treat the rename failures as errors, to catch any future issues. Change-Id: Ibe9caac7ee87dcbc4f581cfbd36173b734859ccb BUG: 1123950 Signed-off-by: Shyam Reviewed-on: http://review.gluster.org/8579 Reviewed-by: Jeff Darcy Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- tests/bugs/bug-1117851.t | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/tests/bugs/bug-1117851.t b/tests/bugs/bug-1117851.t index 8292058cf2f..94f3104fedc 100755 --- a/tests/bugs/bug-1117851.t +++ b/tests/bugs/bug-1117851.t @@ -31,26 +31,18 @@ move_files () { check_files () { errors=0 - warnings=0 for i in {1..1000}; do if [ ! -f $(printf %s/dst%04d $1 $i) ]; then if [ -f $(printf %s/src%04d $1 $i) ]; then - # We do hit this sometimes, though very rarely. - # It's a bug. It's just not *this* bug. - # Therefore, instead of allowing it to cause - # spurious test failures, we let it slide for - # now. Some day, when that other bug is fixed, - # I hope I remember to come back and strengthen - # this test accordingly. echo "file $i didnt get moved" > /dev/stderr - #warnings=$((warnings+1)) + errors=$((errors+1)) else echo "file $i is MISSING" > /dev/stderr errors=$((errors+1)) fi fi done - if [ $((errors+warnings)) != 0 ]; then + if [ $((errors)) != 0 ]; then : ls -l $1 > /dev/stderr fi return $errors @@ -84,9 +76,11 @@ TEST move_files $M1 # It's regrettable that renaming 1000 files might take more than 30 seconds, # but on our test systems sometimes it does, so double the time from what we'd -# use otherwise. -EXPECT_WITHIN 60 "done" cat $M0/status_0 -EXPECT_WITHIN 60 "done" cat $M1/status_1 +# use otherwise. There still seem to be some spurious failures, 1 in 20 when +# this does not complete, added an additional 15 seconds to take false reports +# out of the system, during test runs. +EXPECT_WITHIN 75 "done" cat $M0/status_0 +EXPECT_WITHIN 75 "done" cat $M1/status_1 TEST umount $M0 TEST umount $M1 -- cgit