From 6d083f47e1399c58da02836f33fdb7d9c31fd689 Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Mon, 30 Mar 2015 13:22:45 -0400 Subject: tests: fix volume_exists to be used from EXPECT_WITHIN Fixes the spurious volume-snapshot-clone.t regression failures. In brief, the problem is that the script wasn't waiting for config commands to complete, and would *sometimes* query the status of a volume while that volume was still being deleted. It turns out that "!" doesn't work properly from EXPECT_WITHIN, so there was a choice between changing that or changing volume_exists. This seemed less risky. Because of code duplication, two instances of the function had to be changed, and the other caller (volume-snapshot.t) did too. Change-Id: I766d4dc7c5b11038ede8e45d9d1f29cd02a622a0 BUG: 1163543 Signed-off-by: Jeff Darcy Reviewed-on: http://review.gluster.org/10053 Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY Reviewed-by: Vijay Bellur --- tests/basic/volume-snapshot-clone.t | 8 ++++---- tests/basic/volume-snapshot.t | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/basic') diff --git a/tests/basic/volume-snapshot-clone.t b/tests/basic/volume-snapshot-clone.t index b142804e51b..17e51d91a81 100755 --- a/tests/basic/volume-snapshot-clone.t +++ b/tests/basic/volume-snapshot-clone.t @@ -98,8 +98,8 @@ EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field ${V0}_clone 'Status'; EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field ${V1}_clone 'Status'; #Clean up stop_force_volumes 2 -EXPECT 'Stopped' volinfo_field $V0 'Status'; -EXPECT 'Stopped' volinfo_field $V1 'Status'; +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT 'Stopped' volinfo_field $V0 'Status'; +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT 'Stopped' volinfo_field $V1 'Status'; TEST delete_snapshot ${V0}_snap TEST delete_snapshot ${V1}_snap @@ -108,7 +108,7 @@ TEST ! snapshot_exists 1 ${V0}_snap TEST ! snapshot_exists 1 ${V1}_snap delete_volumes 2 -TEST ! volume_exists $V0 -TEST ! volume_exists $V1 +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "N" volume_exists $V0 +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "N" volume_exists $V1 cleanup; diff --git a/tests/basic/volume-snapshot.t b/tests/basic/volume-snapshot.t index 65ce54b0a26..7987d4039d3 100755 --- a/tests/basic/volume-snapshot.t +++ b/tests/basic/volume-snapshot.t @@ -143,7 +143,7 @@ TEST ! snapshot_exists 1 ${V0}_snap TEST ! snapshot_exists 1 ${V1}_snap delete_volumes 2 -TEST ! volume_exists $V0 -TEST ! volume_exists $V1 +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "N" volume_exists $V0 +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "N" volume_exists $V1 cleanup; -- cgit