summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSushilG96 <guptarahul201010@gmail.com>2020-05-28 15:16:13 +0530
committerVaibhav Mahajan <vamahaja@redhat.com>2020-06-01 12:51:44 +0000
commit11edcd4fd059f47bafeb36da28862d96a1975683 (patch)
tree2dbb4334cbbd756a28c95ee20abdebc9a7cc7d91 /tests
parentb6d9bcff82f4a9aa06c64e5b76b5d5f120b28bf6 (diff)
[TestFix] Add waiter to complete heketi db pending operations
Change-Id: I4554daf04c97e28bd965e2509c53e13b7808bae6 Signed-off-by: susgupta <susgupta@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/heketi/test_heketi_create_volume.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/functional/heketi/test_heketi_create_volume.py b/tests/functional/heketi/test_heketi_create_volume.py
index 54a4a46..1e022f5 100644
--- a/tests/functional/heketi/test_heketi_create_volume.py
+++ b/tests/functional/heketi/test_heketi_create_volume.py
@@ -461,17 +461,25 @@ class TestHeketiVolume(BaseClass):
h_db_check_bricks_before = h_db_check_before["bricks"]
h_db_check_vol_before = h_db_check_before["{}volumes".format(vol_type)]
- # Check file/block volume pending operations before creation.
- if h_db_check_vol_before["pending"]:
- self.skipTest(
- "Skip TC due to unexpected {}volumes pending operations"
- .format(vol_type))
+ # Verify file/block volumes pending operation before creation
+ # Wait for few min's if found and pending operation or skip tc
+ for w in waiter.Waiter(timeout=300, interval=10):
+ h_db_check_before = heketi_db_check(h_node, h_url)
+ h_db_check_bricks_before = h_db_check_before["bricks"]
+ h_db_check_vol_before = h_db_check_before["{}volumes".format(
+ vol_type)]
- # Check bricks pending operations before creation.
- if h_db_check_bricks_before["pending"]:
+ if(not(h_db_check_vol_before["pending"]
+ and h_db_check_bricks_before["pending"])):
+ break
+
+ if w.expired:
self.skipTest(
- "Skip TC due to unexpected bricks pending operations for"
- " {}volume".format(vol_type))
+ "Skip TC due to unexpected {} volumes or {} bricks pending"
+ " operations for {}volume".format(
+ h_db_check_vol_before["pending"],
+ h_db_check_bricks_before["pending"],
+ vol_type))
# Fetch BHV list
if vol_type == 'block':