functional tests: don't run journal timer
don't run journal timer for functional tests. If tearDown/setUp() is called during journal thread is running by timer, journal thread may be upset by sudden db transaction and abort. Change-Id: Ic34a703ac7ceb877175fc299b7e0d7b39ba6db63 Closes-bug: #1700850
This commit is contained in:
		@@ -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(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user