Merge "Ensure PostgreSQL connection errors are wrapped"
This commit is contained in:
commit
98b434db7d
@ -270,6 +270,7 @@ def _raise_operational_errors_directly_filter(operational_error,
|
|||||||
|
|
||||||
|
|
||||||
@filters("mysql", sqla_exc.OperationalError, r".*\(.*(?:2002|2003|2006|2013)")
|
@filters("mysql", sqla_exc.OperationalError, r".*\(.*(?:2002|2003|2006|2013)")
|
||||||
|
@filters("postgresql", sqla_exc.OperationalError, r".*could not connect to server") # noqa
|
||||||
@filters("ibm_db_sa", sqla_exc.OperationalError, r".*(?:30081)")
|
@filters("ibm_db_sa", sqla_exc.OperationalError, r".*(?:30081)")
|
||||||
def _is_db_connection_error(operational_error, match, engine_name,
|
def _is_db_connection_error(operational_error, match, engine_name,
|
||||||
is_disconnect):
|
is_disconnect):
|
||||||
|
@ -745,6 +745,21 @@ class TestDBDisconnected(TestsExceptionFilter):
|
|||||||
is_disconnect=False
|
is_disconnect=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_postgresql_ping_listener_disconnected(self):
|
||||||
|
self._test_ping_listener_disconnected(
|
||||||
|
"postgresql",
|
||||||
|
self.OperationalError(
|
||||||
|
"could not connect to server: Connection refused"),
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_postgresql_ping_listener_disconnected_regex_only(self):
|
||||||
|
self._test_ping_listener_disconnected(
|
||||||
|
"postgresql",
|
||||||
|
self.OperationalError(
|
||||||
|
"could not connect to server: Connection refused"),
|
||||||
|
is_disconnect=False
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TestDBConnectRetry(TestsExceptionFilter):
|
class TestDBConnectRetry(TestsExceptionFilter):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user