Don't use .delete() on a port in unit test
The following patch will throw errors if this is done since it's bad behavior (even though it doesn't impact this particular test). TrivialFix Change-Id: I9b75bdfca1cba385debfd177103314c25a23becf
This commit is contained in:
parent
9dea90d453
commit
bf56b8586a
@ -57,7 +57,10 @@ class TestRevisionPlugin(test_plugin.Ml2PluginV2TestCase):
|
|||||||
# load port into our session
|
# load port into our session
|
||||||
port_obj = self.ctx.session.query(models_v2.Port).one()
|
port_obj = self.ctx.session.query(models_v2.Port).one()
|
||||||
# simulate concurrent delete in another session
|
# simulate concurrent delete in another session
|
||||||
nctx.get_admin_context().session.query(models_v2.Port).delete()
|
other_ctx = nctx.get_admin_context()
|
||||||
|
other_ctx.session.delete(
|
||||||
|
other_ctx.session.query(models_v2.Port).first()
|
||||||
|
)
|
||||||
# expire the port so the revision bumping code will trigger a
|
# expire the port so the revision bumping code will trigger a
|
||||||
# lookup on its attributes and encounter an ObjectDeletedError
|
# lookup on its attributes and encounter an ObjectDeletedError
|
||||||
self.ctx.session.expire(port_obj)
|
self.ctx.session.expire(port_obj)
|
||||||
|
Loading…
Reference in New Issue
Block a user