From 263e23c52fb66b218d85254dcb2b54ab51832ba4 Mon Sep 17 00:00:00 2001 From: Sachin Pandit Date: Tue, 10 Mar 2015 10:19:51 +0530 Subject: tests : Fix spurious failure in uss.t. Problem : When we change the USS working directory, the change is reflected in the volfile. So whenever snapd tries to fetch the current USS directory there is some delay and because of that if any lookup operation comes at that time on new USS directory there might be chances of failure. Solution : Check whether the directory exits in "EXPECT_WITHIN" as we can check few time if change is getting reflected. ================================================== ok 84 ok 85 ok 86 ok 87 ls: cannot access /mnt/glusterfs/0/.history: No such file or directory not ok 88 FAILED COMMAND: ls /mnt/glusterfs/0/.history ok 89 ok 90 ok 91 ok 92 ok 93 =================================================== Change-Id: Id739a929198829d9980ee4af44248c9e426caabe BUG: 1165938 Signed-off-by: Sachin Pandit Reviewed-on: http://review.gluster.org/9850 Tested-by: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Raghavendra Bhat --- tests/basic/uss.t | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/basic/uss.t b/tests/basic/uss.t index eeccb28be05..0e2b669ee7a 100644 --- a/tests/basic/uss.t +++ b/tests/basic/uss.t @@ -12,6 +12,17 @@ function check_readonly() return $? } +function lookup() +{ + ls $1 + if [ "$?" == "0" ] + then + echo "Y" + else + echo "N" + fi +} + cleanup; TESTS_EXPECTED_IN_LOOP=10 @@ -177,6 +188,10 @@ TEST fd_close $fd3; # test 73 TEST $CLI volume set $V0 "features.snapshot-directory" .history +# snapd client might take fraction of time to compare the volfile from +# glusterd. hence a EXPECT_WITHIN is a better choice here +EXPECT_WITHIN 2 "Y" lookup "$M0/.history"; + TEST ls $M0/.history; NUM_SNAPS=$(ls $M0/.history | wc -l); -- cgit