From 0e37cdf271a48d3e58c212e95664a2aa34da3940 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 11 Sep 2019 14:41:28 +0530 Subject: tests: Fix spurious failure If heal from next brick starts after the first brick completes heal, then opendir on the brick can change atime leading to failure of the test. When ctime is disabled it is better to just check mtime to be same after heal. fixes: bz#1751134 Change-Id: Ia03e30fd547e6bbe85c1e299845ffa122f3a2692 Signed-off-by: Pranith Kumar K --- .../bug-1734370-entry-heal-restore-time.t | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'tests/bugs') diff --git a/tests/bugs/replicate/bug-1734370-entry-heal-restore-time.t b/tests/bugs/replicate/bug-1734370-entry-heal-restore-time.t index 26f3b2615fd..431002290f8 100644 --- a/tests/bugs/replicate/bug-1734370-entry-heal-restore-time.t +++ b/tests/bugs/replicate/bug-1734370-entry-heal-restore-time.t @@ -21,7 +21,23 @@ function time_stamps_match { then echo "Y" else - echo "N" + echo "Mtimes: $mtime_source_b0:$mtime_sink_b1:$mtime_source_b2 Atimes: $atime_source_b0:$atime_sink_b1:$atime_source_b2" + fi + +} + +function mtimes_match { + path=$1 + mtime_source_b0=$(get_mtime $B0/${V0}0/$path) + mtime_source_b2=$(get_mtime $B0/${V0}2/$path) + mtime_sink_b1=$(get_mtime $B0/${V0}1/$path) + + if [[ ( $mtime_source_b0 -eq $mtime_sink_b1) || \ + ( $mtime_source_b2 -eq $mtime_sink_b1) ]] + then + echo "Y" + else + echo "Mtimes: $mtime_source_b0:$mtime_sink_b1:$mtime_source_b2" fi } @@ -70,9 +86,11 @@ EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0 EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1 EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 2 TEST $CLI volume heal $V0 +#Executing parallel heal may lead to changing atime after heal. So better +#to test just the mtime EXPECT_WITHIN $HEAL_TIMEOUT "0" get_pending_heal_count $V0 -EXPECT "Y" time_stamps_match DIR2 +EXPECT "Y" mtimes_match DIR2 TEST rm $GET_MDATA_PATH/get-mdata-xattr cleanup; -- cgit