From 8fc4b9ba5acf06a7fd57ae24377e95389b00748d Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Tue, 12 Sep 2023 13:50:58 +0200 Subject: [PATCH] on PVC when_scaled:retain check pod count, too (#2415) * on PVC when_scaled:retain check pod count and wait for replica label --- e2e/tests/test_e2e.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/e2e/tests/test_e2e.py b/e2e/tests/test_e2e.py index 18b266b69..ff5b6d4bf 100644 --- a/e2e/tests/test_e2e.py +++ b/e2e/tests/test_e2e.py @@ -1254,11 +1254,13 @@ class EndToEndTestCase(unittest.TestCase): k8s.api.custom_objects_api.patch_namespaced_custom_object( 'acid.zalan.do', 'v1', 'default', 'postgresqls', 'acid-minimal-cluster', pg_patch_scale_down_instances) self.eventuallyEqual(lambda: k8s.get_operator_state(), {"0": "idle"},"Operator does not get in sync") + self.eventuallyEqual(lambda: k8s.count_running_pods(), 1, "Scale down to 1 failed") self.eventuallyEqual(lambda: k8s.count_pvcs_with_label(cluster_label), 2, "PVCs is deleted when scaled down") k8s.api.custom_objects_api.patch_namespaced_custom_object( 'acid.zalan.do', 'v1', 'default', 'postgresqls', 'acid-minimal-cluster', pg_patch_scale_up_instances) self.eventuallyEqual(lambda: k8s.get_operator_state(), {"0": "idle"},"Operator does not get in sync") + k8s.wait_for_pod_start('spilo-role=replica,' + cluster_label) self.eventuallyEqual(lambda: k8s.count_pvcs_with_label(cluster_label), 2, "PVCs is not equal to number of instances") @timeout_decorator.timeout(TEST_TIMEOUT_SEC)