From: Mukund Sivaraman Date: Thu, 29 Nov 2012 01:24:34 +0000 (+0530) Subject: [2353] Use a flag instead of overriding BoB.msgq_timeout X-Git-Tag: bind10-1.0.0-beta-release~19^2~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0688fdb85ded658b2ecf5aceb6e4691cb921ddfb;p=thirdparty%2Fkea.git [2353] Use a flag instead of overriding BoB.msgq_timeout --- diff --git a/src/bin/bind10/bind10_src.py.in b/src/bin/bind10/bind10_src.py.in index aa92c5d7f9..1a01e34f82 100755 --- a/src/bin/bind10/bind10_src.py.in +++ b/src/bin/bind10/bind10_src.py.in @@ -217,6 +217,7 @@ class BoB: self.cmdctl_port = cmdctl_port self.wait_time = wait_time self.msgq_timeout = 5 + self.run_under_unittests = False self._component_configurator = isc.bind10.component.Configurator(self, isc.bind10.special_component.get_specials()) # The priorities here make them start in the correct order. First @@ -431,8 +432,8 @@ class BoB: # Now connect to the c-channel cc_connect_start = time.time() while self.cc_session is None: - # this is only used by unittests - if self.msgq_timeout == 0: + # if we are run under unittests, break + if self.run_under_unittests: break # if we have been trying for "a while" give up diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in index ed7f14a528..eee942a64a 100644 --- a/src/bin/bind10/tests/bind10_test.py.in +++ b/src/bin/bind10/tests/bind10_test.py.in @@ -1568,7 +1568,7 @@ class TestBossComponents(unittest.TestCase): '''Test that b10-msgq is started.''' bob = MockBobSimple() bob.c_channel_env = {} - bob.msgq_timeout = 0 + bob.run_under_unittests = True # use the MockProcessInfo creator bob._make_process_info = bob._make_mock_process_info @@ -1604,6 +1604,9 @@ class TestBossComponents(unittest.TestCase): bob.c_channel_env = {} # keep the timeout small for the test to complete quickly bob.msgq_timeout = 1 + # specifically set this to False so that the connect is + # attempted + bob.run_under_unittests = False # use the MockProcessInfo creator bob._make_process_info = bob._make_mock_process_info