Parcourir la source

[2353] Use a flag instead of overriding BoB.wait_time

Mukund Sivaraman il y a 12 ans
Parent
commit
41ccdad87b
2 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. 2 3
      src/bin/bind10/bind10_src.py.in
  2. 5 1
      src/bin/bind10/tests/bind10_test.py.in

+ 2 - 3
src/bin/bind10/bind10_src.py.in

@@ -484,9 +484,8 @@ class BoB:
             time_remaining = time_remaining - 1
             msg, env = self.cc_session.group_recvmsg()
         
-        # wait_time is set to 0 only by unittests
-        if self.wait_time > 0 and not self.process_running(msg,
-                                                           "ConfigManager"):
+        if not self.process_running(msg, "ConfigManager") and \
+                not self.run_under_unittests:
             raise ProcessStartError("Configuration manager process has not started")
 
         return bind_cfgd

+ 5 - 1
src/bin/bind10/tests/bind10_test.py.in

@@ -1644,7 +1644,7 @@ class TestBossComponents(unittest.TestCase):
         bob = MockBobSimple()
         bob.c_channel_env = {}
         bob.cc_session = DummySession()
-        bob.wait_time = 0
+        bob.run_under_unittests = True
 
         # use the MockProcessInfo creator
         bob._make_process_info = bob._make_mock_process_info
@@ -1706,7 +1706,11 @@ class TestBossComponents(unittest.TestCase):
         bob = MockBobSimple()
         bob.c_channel_env = {}
         bob.cc_session = DummySession()
+        # keep the wait time small for the test to complete quickly
         bob.wait_time = 2
+        # specifically set this to False so that the process check is
+        # attempted
+        bob.run_under_unittests = False
 
         # use the MockProcessInfo creator
         bob._make_process_info = bob._make_mock_process_info