File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -1432,10 +1432,10 @@ def _on_config_changed(self, event) -> None: # noqa: C901
1432
1432
self ._validate_config_options ()
1433
1433
# update config on every run
1434
1434
self .update_config ()
1435
- except psycopg2 .OperationalError :
1436
- logger .debug ("Defer on_config_changed: Cannot connect to database" )
1437
- event .defer ()
1438
- return
1435
+ # except psycopg2.OperationalError:
1436
+ # logger.debug("Defer on_config_changed: Cannot connect to database")
1437
+ # event.defer()
1438
+ # return
1439
1439
except ValueError as e :
1440
1440
self .set_unit_status (BlockedStatus ("Configuration Error. Please check the logs" ))
1441
1441
logger .error ("Invalid configuration: %s" , str (e ))
Original file line number Diff line number Diff line change 28
28
WaitingStatus ,
29
29
)
30
30
from ops .testing import Harness
31
- from psycopg2 import OperationalError
31
+
32
+ # from psycopg2 import OperationalError
32
33
from tenacity import RetryError , wait_fixed
33
34
34
35
from backups import CANNOT_RESTORE_PITR
@@ -280,12 +281,12 @@ def test_on_config_changed(harness):
280
281
_enable_disable_extensions .assert_not_called ()
281
282
282
283
# Test unable to connect to db
283
- _update_config .reset_mock ()
284
- _validate_config_options .side_effect = OperationalError
285
- harness .charm .on .config_changed .emit ()
286
- assert not _update_config .called
287
- _validate_config_options .side_effect = None
288
- _updated_synchronous_node_count .assert_called_once_with ()
284
+ # _update_config.reset_mock()
285
+ # _validate_config_options.side_effect = OperationalError
286
+ # harness.charm.on.config_changed.emit()
287
+ # assert not _update_config.called
288
+ # _validate_config_options.side_effect = None
289
+ # _updated_synchronous_node_count.assert_called_once_with()
289
290
290
291
# Test after the cluster was initialised.
291
292
with harness .hooks_disabled ():
You can’t perform that action at this time.
0 commit comments