Skip to content

Commit fe50c6c

Browse files
committed
Change condition back to 'ContainersReady'
Increase time of waiting fot Deployment removal
1 parent 50a0437 commit fe50c6c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/suite/resources_utils.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,21 @@ def create_daemon_set(extensions_v1_beta1: ExtensionsV1beta1Api, namespace, body
157157

158158
def wait_until_all_pods_are_ready(v1: CoreV1Api, namespace) -> None:
159159
"""
160-
Wait for all the pods to be 'Ready'.
160+
Wait for all the pods to be 'ContainersReady'.
161161
162162
:param v1: CoreV1Api
163163
:param namespace: namespace of a pod
164164
:return:
165165
"""
166-
print("Start waiting for all pods in a namespace to be Ready")
166+
print("Start waiting for all pods in a namespace to be ContainersReady")
167167
counter = 0
168168
while not are_all_pods_in_ready_state(v1, namespace) and counter < 20:
169-
print("There are pods that are not running. Wait for 4 sec...")
169+
print("There are pods that are not ContainersReady. Wait for 4 sec...")
170170
time.sleep(4)
171171
counter = counter + 1
172172
if counter >= 20:
173-
pytest.fail("After several seconds the pods aren't Ready. Exiting...")
174-
print("All pods are Ready")
173+
pytest.fail("After several seconds the pods aren't ContainersReady. Exiting...")
174+
print("All pods are ContainersReady")
175175

176176

177177
def get_first_pod_name(v1: CoreV1Api, namespace) -> str:
@@ -188,7 +188,7 @@ def get_first_pod_name(v1: CoreV1Api, namespace) -> str:
188188

189189
def are_all_pods_in_ready_state(v1: CoreV1Api, namespace) -> bool:
190190
"""
191-
Check if all the pods have Ready condition.
191+
Check if all the pods have ContainersReady condition.
192192
193193
:param v1: CoreV1Api
194194
:param namespace: namespace
@@ -203,7 +203,7 @@ def are_all_pods_in_ready_state(v1: CoreV1Api, namespace) -> bool:
203203
return False
204204
for condition in pod.status.conditions:
205205
# wait for 'Ready' state instead of 'ContainersReady' for backwards compatibility with k8s 1.10
206-
if condition.type == 'Ready' and condition.status == 'True':
206+
if condition.type == 'ContainersReady' and condition.status == 'True':
207207
pod_ready_amount = pod_ready_amount + 1
208208
break
209209
return pod_ready_amount == len(pods.items)
@@ -385,12 +385,12 @@ def ensure_item_removal(get_item, *args, **kwargs) -> None:
385385
"""
386386
try:
387387
counter = 0
388-
while counter < 20:
388+
while counter < 30:
389389
time.sleep(1)
390390
get_item(*args, **kwargs)
391391
counter = counter + 1
392-
if counter >= 20:
393-
pytest.fail("Failed to remove the item after 20 seconds")
392+
if counter >= 30:
393+
pytest.fail("Failed to remove the item after 30 seconds")
394394
except ApiException as ex:
395395
if ex.status == 404:
396396
print("Item was removed")

0 commit comments

Comments
 (0)