Catch possible pods count error.

This commit is contained in:
Jan Mußler 2020-10-27 20:31:16 +01:00
parent 474d4d974e
commit cabb7bc59f
1 changed files with 3 additions and 0 deletions

View File

@ -564,6 +564,9 @@ class EndToEndTestCase(unittest.TestCase):
def verify_pod_limits():
pods = k8s.api.core_v1.list_namespaced_pod('default', label_selector="cluster-name=acid-minimal-cluster,application=spilo").items
if len(pods)<2:
return False
r = pods[0].spec.containers[0].resources.limits['memory']==minMemoryLimit
r = r and pods[0].spec.containers[0].resources.limits['cpu'] == minCPULimit
r = r and pods[1].spec.containers[0].resources.limits['memory']==minMemoryLimit