path: root/openshift-storage-libs
diff options
authorValerii Ponomarov <>2019-05-29 00:00:47 +0530
committerValerii Ponomarov <>2019-05-29 00:18:04 +0530
commit30c009cde35d8cb3b2e755cd9ea71e172c8a4290 (patch)
treefcd34489ecf807e38a7f00fbd43226a5a9ff2984 /openshift-storage-libs
parent0b5396082a89dc04fbd998e679ea709f8dc38b46 (diff)
Fix 'test_pv_resize_by_exact_free_space' tc
It was broken it 2 places: - It is first tc in the 'resize' test suite, which runs right after OCP API restart. And it happens to fail to talk to the OCP API. So, fix it by adding API service waiter in place where we restart it. - In this tc we delete huge volume which consumes almost whole disk space. And happens that this operation takes up to the 6 minutes. But we were waiting only for 5 minutes. So, just increase timeout. Change-Id: Ic6ada67b96ac8a37d13f57c0576e862226517b0d
Diffstat (limited to 'openshift-storage-libs')
2 files changed, 12 insertions, 2 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/ b/openshift-storage-libs/openshiftstoragelibs/
index b6d086a..44834dc 100644
--- a/openshift-storage-libs/openshiftstoragelibs/
+++ b/openshift-storage-libs/openshiftstoragelibs/
@@ -631,7 +631,7 @@ def create_namespace(hostname, namespace):
def wait_for_resource_absence(ocp_node, rtype, name,
- interval=5, timeout=300):
+ interval=5, timeout=600):
_waiter = waiter.Waiter(timeout=timeout, interval=interval)
resource, pv_name = None, None
for w in _waiter:
diff --git a/openshift-storage-libs/openshiftstoragelibs/ b/openshift-storage-libs/openshiftstoragelibs/
index e9ad670..aef6396 100644
--- a/openshift-storage-libs/openshiftstoragelibs/
+++ b/openshift-storage-libs/openshiftstoragelibs/
@@ -7,6 +7,7 @@ from openshiftstoragelibs.exceptions import (
from openshiftstoragelibs.openshift_version import get_openshift_version
+from openshiftstoragelibs import waiter
MASTER_CONFIG_FILEPATH = "/etc/origin/master/master-config.yaml"
@@ -115,7 +116,16 @@ def enable_pvc_resize(master_node):
raise ExecutionError(err_msg)
- return True
+ # Wait for API service to be ready after the restart
+ for w in waiter.Waiter(timeout=120, interval=1):
+ try:
+ cmd_run("oc get nodes", master_node)
+ return True
+ except AssertionError:
+ continue
+ err_msg = "Exceeded 120s timeout waiting for OCP API to start responding."
+ g.log.error(err_msg)
+ raise ExecutionError(err_msg)
def get_iscsi_session(node, iqn=None, raise_on_error=True):