diff --git a/networking_odl/tests/functional/base.py b/networking_odl/tests/functional/base.py index 6f3fb0b42..be529f2f8 100644 --- a/networking_odl/tests/functional/base.py +++ b/networking_odl/tests/functional/base.py @@ -16,6 +16,7 @@ import functools +import mock from neutron.common import utils from neutron.plugins.ml2 import config from neutron.tests.unit.plugins.ml2 import test_plugin @@ -24,6 +25,7 @@ from networking_odl.common import client from networking_odl.common import constants as odl_const from networking_odl.common import utils as odl_utils from networking_odl.db import db +from networking_odl.journal import journal from networking_odl.tests.unit import test_base_db @@ -90,6 +92,14 @@ class OdlTestsBase(object): class V2DriverAdjustment(test_base_db.ODLBaseDbTestCase): + def setUp(self): + # NOTE(yamahata): for functional test, timer isn't needed. + # and if tearDown/setUp() is called during journal thread is running + # by timer, journal thread may be upset by sudden db transaction. + mock.patch.object(journal.OpenDaylightJournalThread, + '_start_sync_timer') + super(V2DriverAdjustment, self).setUp() + def get_odl_resource(self, resource_type, resource): def no_journal_rows(): pending_rows = db.get_all_db_rows_by_state(