diff --git a/neutron/tests/base.py b/neutron/tests/base.py index 800ca4f0eba..ea14fd8b513 100644 --- a/neutron/tests/base.py +++ b/neutron/tests/base.py @@ -31,6 +31,7 @@ from neutron_lib.db import api as db_api from neutron_lib import fixture from oslo_concurrency.fixture import lockutils from oslo_config import cfg +from oslo_db import exception as db_exceptions from oslo_db import options as db_options from oslo_messaging import conffixture as messaging_conffixture from oslo_utils import excutils @@ -123,7 +124,8 @@ def skip_if_timeout(reason): msg = ("Timeout raised for test %s, skipping it " "because of: %s") % (self.id(), reason) raise self.skipTest(msg) - except sqlalchemy_exc.InterfaceError: + except (sqlalchemy_exc.InterfaceError, + db_exceptions.DBConnectionError): # In case of db tests very often TimeoutException is reason of # some sqlalchemy InterfaceError exception and that is final # raised exception which needs to be handled