From a97ad9b69bb17f2351c59512fa9c6cb25d82b4da Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Thu, 18 Sep 2014 18:42:34 +0200 Subject: test/ec: Fix spurious failures caused by self-heal The sha1sum of a file may update the access time of that file. If this happens while a brick is down, as it is forced in the test, that brick doesn't get the update, getting out of sync. When the brick is restarted, self-heal repairs the file, but the test shouldn't access brick contents until self-heal finishes. If this is combined with a kill of another brick before self-heal has finished repairing the file, the volume could become inaccessible. Since the purpose of these tests is only to check ec functionality (there is another test that checks self-heal), the test that corrupts the file has been removed. Additional checks to validate the state of the volume have been added to avoid some timing issues. BUG: 1144108 Change-Id: Ibd9288de519914663998a1fbc4321ec92ed6082c Signed-off-by: Xavier Hernandez Reviewed-on: http://review.gluster.org/8892 Reviewed-by: Emmanuel Dreyfus Tested-by: Emmanuel Dreyfus Tested-by: Gluster Build System Reviewed-by: Dan Lambright Reviewed-by: Vijay Bellur --- tests/basic/ec/ec-common | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'tests/basic/ec/ec-common') diff --git a/tests/basic/ec/ec-common b/tests/basic/ec/ec-common index 92e6499fa87..7abb4f2176d 100644 --- a/tests/basic/ec/ec-common +++ b/tests/basic/ec/ec-common @@ -23,8 +23,11 @@ fi TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 redundancy $REDUNDANCY $H0:$B0/${V0}{0..$LAST_BRICK} +EXPECT 'Created' volinfo_field $V0 'Status' TEST $CLI volume start $V0 -TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field $V0 'Status' +TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "$DISPERSE" ec_child_up_count $V0 0 TEST dd if=/dev/urandom of=$tmp/small bs=1024 count=1 TEST dd if=/dev/urandom of=$tmp/big bs=1024 count=4096 @@ -82,15 +85,9 @@ for dir in . dir1; do EXPECT "1024" stat -c "%s" $dir/small EXPECT "4194304" stat -c "%s" $dir/big - EXPECT "$cs_small" echo $(sha1sum $dir/small | awk '{ print $1 }') - EXPECT "$cs_big" echo $(sha1sum $dir/big | awk '{ print $1 }') - - cd - EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 - TEST $CLI volume stop $V0 force - TEST $CLI volume start $V0 - TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; - cd $M0 + + TEST $CLI volume start $V0 force + EXPECT_WITHIN $CHILD_UP_TIMEOUT "$DISPERSE" ec_child_up_count $V0 0 done for size in $SIZE_LIST; do -- cgit