e2e: wait for replica after failover before fetching leader (#1649)

This commit is contained in:
Felix Kunde 2021-10-14 17:58:53 +02:00 committed by GitHub
parent 08665bb2b1
commit 6caf3a5359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -1177,6 +1177,7 @@ class EndToEndTestCase(unittest.TestCase):
# operator should now recreate the master pod and do a switchover before # operator should now recreate the master pod and do a switchover before
k8s.wait_for_pod_failover(replica_nodes, 'spilo-role=master,' + cluster_label) k8s.wait_for_pod_failover(replica_nodes, 'spilo-role=master,' + cluster_label)
k8s.wait_for_pod_start('spilo-role=replica,' + cluster_label)
# check if the former replica is now the new master # check if the former replica is now the new master
leader = k8s.get_cluster_leader_pod() leader = k8s.get_cluster_leader_pod()
@ -1246,6 +1247,7 @@ class EndToEndTestCase(unittest.TestCase):
# wait for next sync, replica should be running normally by now and be ready for switchover # wait for next sync, replica should be running normally by now and be ready for switchover
k8s.wait_for_pod_failover(replica_nodes, 'spilo-role=master,' + cluster_label) k8s.wait_for_pod_failover(replica_nodes, 'spilo-role=master,' + cluster_label)
k8s.wait_for_pod_start('spilo-role=replica,' + cluster_label)
# check if the former replica is now the new master # check if the former replica is now the new master
leader = k8s.get_cluster_leader_pod() leader = k8s.get_cluster_leader_pod()