From: Mukund Sivaraman Date: Mon, 8 Jul 2013 12:01:53 +0000 (+0530) Subject: [2856] Test UPDATING -> SYNCHRONIZING with and without events in the queue X-Git-Tag: bind10-1.2.0beta1-release~306^2~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e68217dd349bb078aae6029b95e182ed165e7bcf;p=thirdparty%2Fkea.git [2856] Test UPDATING -> SYNCHRONIZING with and without events in the queue --- diff --git a/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py b/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py index 9552612816..291e023a67 100644 --- a/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py +++ b/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py @@ -100,15 +100,25 @@ class TestSegmentInfo(unittest.TestCase): # in UPDATING state this is the same as calling # self.__si_to_synchronizing_state(), but let's try to be # descriptive + # + # a) with no events self.__si_to_updating_state() - self.__sgmt_info.complete_update() + e = self.__sgmt_info.complete_update() + self.assertIsNone(e) + self.assertEqual(self.__sgmt_info.get_state(), SegmentInfo.SYNCHRONIZING) + + # b) with events + self.__si_to_updating_state() + self.__sgmt_info.add_event((81,)) + e = self.__sgmt_info.complete_update() + self.assertIsNone(e) # old_readers is not empty self.assertEqual(self.__sgmt_info.get_state(), SegmentInfo.SYNCHRONIZING) # in SYNCHRONIZING state self.__si_to_synchronizing_state() self.assertRaises(SegmentInfoError, self.__sgmt_info.complete_update) - # in COPYING state + # in COPYING state with no events self.__si_to_copying_state() self.__sgmt_info.complete_update() self.assertEqual(self.__sgmt_info.get_state(), SegmentInfo.READY)