mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Fix bug in kubernetes.update_leader (#1685)
Unhandled exception prevented demoting the primary. In addition to that wrap the update_leader call in the HA loop into try..except block and implement a test case. Fixes https://github.com/zalando/patroni/issues/1684
This commit is contained in:
+2
-1
@@ -200,7 +200,8 @@ class TestHa(PostgresInit):
|
||||
|
||||
def test_update_lock(self):
|
||||
self.p.last_operation = Mock(side_effect=PostgresConnectionException(''))
|
||||
self.assertTrue(self.ha.update_lock(True))
|
||||
self.ha.dcs.update_leader = Mock(side_effect=Exception)
|
||||
self.assertFalse(self.ha.update_lock(True))
|
||||
|
||||
@patch.object(Postgresql, 'received_timeline', Mock(return_value=None))
|
||||
def test_touch_member(self):
|
||||
|
||||
Reference in New Issue
Block a user