Merge "Fix Loki tempest jobs"

This commit is contained in:
Zuul 2023-05-04 20:47:48 +00:00 committed by Gerrit Code Review
commit 598fcb437a
3 changed files with 7 additions and 1 deletions

View File

@ -34,11 +34,13 @@ class LokiPlugin(service_base.ServicePluginBase):
def random_deadlock(self, session, flush_context, instances):
if random.randrange(0, 51) > 49: # 1/50 probability
LOG.info("Loki has raised a DBDeadlock exception, instances %s",
instances)
raise db_exc.DBDeadlock()
def random_delay(self, session, instance):
if random.randrange(0, 201) > 199: # 1/200 probability
LOG.debug("Loki has delayed loading of instance %s", instance)
LOG.info("Loki has delayed loading of instance %s", instance)
time.sleep(1)
def get_plugin_type(self):

View File

@ -170,6 +170,7 @@ class OVNL3RouterPlugin(service_base.ServicePluginBase,
def create_router_precommit(self, resource, event, trigger, payload):
context = payload.context
context.session.flush()
router_id = payload.resource_id
router_db = payload.metadata['router_db']

View File

@ -100,6 +100,7 @@ class TagPlugin(tagging.TagPluginBase):
tag=tag).create()
@log_helpers.log_method_call
@db_api.retry_if_session_inactive()
def update_tag(self, context, resource, resource_id, tag):
res = self._get_resource(context, resource, resource_id)
if any(tag == tag_db.tag for tag_db in res.standard_attr.tags):
@ -111,12 +112,14 @@ class TagPlugin(tagging.TagPluginBase):
pass
@log_helpers.log_method_call
@db_api.retry_if_session_inactive()
def delete_tags(self, context, resource, resource_id):
res = self._get_resource(context, resource, resource_id)
tag_obj.Tag.delete_objects(context,
standard_attr_id=res.standard_attr_id)
@log_helpers.log_method_call
@db_api.retry_if_session_inactive()
def delete_tag(self, context, resource, resource_id, tag):
res = self._get_resource(context, resource, resource_id)
if not tag_obj.Tag.delete_objects(