On role change callback didn't fire on failed primary (#1420)

Bug was introduced in https://github.com/zalando/patroni/pull/703
Close https://github.com/zalando/patroni/issues/1418
This commit is contained in:
Alexander Kukushkin
2020-02-27 12:22:44 +01:00
committed by GitHub
parent bcd75bbeeb
commit 4a29caa9d3
4 changed files with 15 additions and 5 deletions
+3
View File
@@ -134,6 +134,9 @@ class TestPostgresql(BaseTestPostgresql):
self.p.cancellable.cancel()
self.assertFalse(self.p.start())
with patch('patroni.postgresql.config.ConfigHandler.effective_configuration',
PropertyMock(side_effect=Exception)):
self.assertIsNone(self.p.start())
@patch.object(Postgresql, 'pg_isready')
@patch('patroni.postgresql.polling_loop', Mock(return_value=range(1)))