@@ -157,21 +157,21 @@ def create_daemon_set(extensions_v1_beta1: ExtensionsV1beta1Api, namespace, body
157
157
158
158
def wait_until_all_pods_are_ready (v1 : CoreV1Api , namespace ) -> None :
159
159
"""
160
- Wait for all the pods to be 'Ready '.
160
+ Wait for all the pods to be 'ContainersReady '.
161
161
162
162
:param v1: CoreV1Api
163
163
:param namespace: namespace of a pod
164
164
:return:
165
165
"""
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 " )
167
167
counter = 0
168
168
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..." )
170
170
time .sleep (4 )
171
171
counter = counter + 1
172
172
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 " )
175
175
176
176
177
177
def get_first_pod_name (v1 : CoreV1Api , namespace ) -> str :
@@ -188,7 +188,7 @@ def get_first_pod_name(v1: CoreV1Api, namespace) -> str:
188
188
189
189
def are_all_pods_in_ready_state (v1 : CoreV1Api , namespace ) -> bool :
190
190
"""
191
- Check if all the pods have Ready condition.
191
+ Check if all the pods have ContainersReady condition.
192
192
193
193
:param v1: CoreV1Api
194
194
:param namespace: namespace
@@ -203,7 +203,7 @@ def are_all_pods_in_ready_state(v1: CoreV1Api, namespace) -> bool:
203
203
return False
204
204
for condition in pod .status .conditions :
205
205
# 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' :
207
207
pod_ready_amount = pod_ready_amount + 1
208
208
break
209
209
return pod_ready_amount == len (pods .items )
@@ -385,12 +385,12 @@ def ensure_item_removal(get_item, *args, **kwargs) -> None:
385
385
"""
386
386
try :
387
387
counter = 0
388
- while counter < 20 :
388
+ while counter < 30 :
389
389
time .sleep (1 )
390
390
get_item (* args , ** kwargs )
391
391
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" )
394
394
except ApiException as ex :
395
395
if ex .status == 404 :
396
396
print ("Item was removed" )
0 commit comments