fix pod distribution test
This commit is contained in:
parent
414ee5befa
commit
6577a1ab73
|
|
@ -733,7 +733,6 @@ class EndToEndTestCase(unittest.TestCase):
|
||||||
Toggle pod anti affinty to distribute pods accross nodes (replica in particular).
|
Toggle pod anti affinty to distribute pods accross nodes (replica in particular).
|
||||||
'''
|
'''
|
||||||
k8s = self.k8s
|
k8s = self.k8s
|
||||||
failover_targets = self.get_failover_targets(master_node, replica_nodes)
|
|
||||||
|
|
||||||
# enable pod anti affintiy in config map which should trigger movement of replica
|
# enable pod anti affintiy in config map which should trigger movement of replica
|
||||||
patch_enable_antiaffinity = {
|
patch_enable_antiaffinity = {
|
||||||
|
|
@ -742,8 +741,12 @@ class EndToEndTestCase(unittest.TestCase):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
k8s.update_config(patch_enable_antiaffinity)
|
k8s.update_config(patch_enable_antiaffinity)
|
||||||
self.assert_failover(
|
k8s.wait_for_pod_start('spilo-role=master')
|
||||||
master_node, len(replica_nodes), failover_targets, cluster_label)
|
k8s.wait_for_pod_start('spilo-role=replica')
|
||||||
|
|
||||||
|
current_master_node, current_replica_nodes = k8s.get_pg_nodes(cluster_label)
|
||||||
|
self.assertNotEqual(current_master_node, current_replica_nodes,
|
||||||
|
"Both pods are still on the same node {}".format(current_master_node))
|
||||||
|
|
||||||
# now disable pod anti affintiy again which will cause yet another failover
|
# now disable pod anti affintiy again which will cause yet another failover
|
||||||
patch_disable_antiaffinity = {
|
patch_disable_antiaffinity = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue