From d01b00ae2b124dfdd6905e463533a715f1cedc5b 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. This is a backport of http://review.gluster.org/8892/ BUG: 1149118 Change-Id: I8a40b7f07fc8ecd2c721bad1bcdd351dd8504155 Signed-off-by: Xavier Hernandez Reviewed-on: http://review.gluster.org/8902 Tested-by: Gluster Build System Reviewed-by: Dan Lambright --- tests/basic/ec/self-heal.t | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tests/basic/ec/self-heal.t') diff --git a/tests/basic/ec/self-heal.t b/tests/basic/ec/self-heal.t index b7f09a56cd6..9d5e5844062 100644 --- a/tests/basic/ec/self-heal.t +++ b/tests/basic/ec/self-heal.t @@ -17,8 +17,11 @@ TESTS_EXPECTED_IN_LOOP=250 TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 redundancy 2 $H0:$B0/${V0}{0..5} +EXPECT "Created" volinfo_field $V0 'Status' TEST $CLI volume start $V0 -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Started" volinfo_field $V0 'Status' +TEST glusterfs --entry-timeout=0 --attribute-timeout=0 --volfile-id=/$V0 --volfile-server=$H0 $M0; +EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count $V0 0 TEST dd if=/dev/urandom of=$tmp/test bs=1024 count=1024 @@ -91,12 +94,8 @@ TEST [ -f test4 ] EXPECT "2" stat -c "%h" test2 EXPECT "2" stat -c "%h" test4 -cd -TEST umount $M0 -TEST $CLI volume stop $V0 force -TEST $CLI volume start $V0 -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 -cd $M0 +TEST $CLI volume start $V0 force +EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count $V0 0 EXPECT "1048576" stat -c "%s" test2 EXPECT "-rwxrwxrwx" stat -c "%A" test2 -- cgit