From a6af531339c870bdc330f3343c91dce3e6757c3e Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 8 Apr 2015 17:29:10 +0900 Subject: [PATCH] l2pop UT: Expire cached db objects before reusing a session Partial-Bug: #1441488 Change-Id: Ic22ae49d99b52e9f650ea0ed638842e7c91831af --- .../tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py b/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py index 06a9b26c6..bbfe282d0 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py +++ b/neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py @@ -828,6 +828,8 @@ class TestL2PopulationRpcTestCase(test_plugin.Ml2PluginV2TestCase): self.assertEqual(res['port']['binding:host_id'], L2_AGENT_2['host']) self.mock_fanout.reset_mock() + # NOTE(yamamoto): see bug #1441488 + self.adminContext.session.expire_all() self.callbacks.get_device_details( self.adminContext, device=device1, @@ -883,6 +885,8 @@ class TestL2PopulationRpcTestCase(test_plugin.Ml2PluginV2TestCase): self.assertEqual(res['port']['binding:host_id'], L2_AGENT_4['host']) self.mock_fanout.reset_mock() + # NOTE(yamamoto): see bug #1441488 + self.adminContext.session.expire_all() self.callbacks.get_device_details( self.adminContext, device=device1, -- 2.45.2