BIND 10 trac2353, updated. f117a66b8be41e88a18a27bd7b2f1275b624767a [2353] Test BoB.start_msgq() timeout checks
BIND 10 source code commits
bind10-changes at lists.isc.org
Sun Nov 18 23:09:30 UTC 2012
The branch, trac2353 has been updated
via f117a66b8be41e88a18a27bd7b2f1275b624767a (commit)
from 77c012c47a2bd2ff161b8b62df065b3daa87ff73 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f117a66b8be41e88a18a27bd7b2f1275b624767a
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Nov 19 04:39:18 2012 +0530
[2353] Test BoB.start_msgq() timeout checks
-----------------------------------------------------------------------
Summary of changes:
src/bin/bind10/tests/bind10_test.py.in | 34 ++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
-----------------------------------------------------------------------
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
index a417210..6410476 100644
--- a/src/bin/bind10/tests/bind10_test.py.in
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -1590,6 +1590,40 @@ class TestBossComponents(unittest.TestCase):
# this is set by ProcessInfo.spawn()
self.assertEqual(42147, pi.pid)
+ def test_start_msgq_timeout(self):
+ '''Test that b10-msgq startup attempts connections several times
+ and times out eventually.'''
+ bob = MockBobSimple()
+ bob.c_channel_env = {}
+ # keep the timeout small for the test to complete quickly
+ bob.msgq_timeout = 1
+
+ # use the MockProcessInfo creator
+ bob._make_process_info = bob._make_mock_process_info
+
+ global attempts
+ attempts = 0
+ tmp_time = time.time
+ def _my_time():
+ global attempts
+ attempts += 1
+ return tmp_time()
+ time.time = _my_time
+
+ thrown = False
+ # An exception will be thrown here when it eventually times out.
+ try:
+ pi = bob.start_msgq()
+ except bind10_src.CChannelConnectError as e:
+ thrown = True
+
+ # We just check that an exception was thrown, and that several
+ # attempts were made to connect.
+ self.assertTrue(thrown)
+ # 1 second of attempts every 0.1 seconds should result in at least 5 attempts, but less than 15
+ self.assertGreater(attempts, 5)
+ self.assertLess(attempts, 15)
+
def test_start_cfgmgr(self):
'''Test that b10-cfgmgr is started.'''
class DummySession():
More information about the bind10-changes
mailing list