Exemple #1
0
 def test_done_draining_past_timeout_even_if_there_are_connections(self):
     """
     If there are still connections, but the node has been in draining past
     the timeout, :func:`CLBNode.is_done_draining` returns `True`.
     """
     node = CLBNode(node_id="1234", description=self.drain_desc, address="10.1.1.1", drained_at=0.0, connections=1)
     self.assertTrue(node.is_done_draining(now=30, timeout=15))
Exemple #2
0
 def test_done_draining_before_timeout_if_there_are_no_connections(self):
     """
     If there are zero connections, but the node has been in draining less
     than the timeout, :func:`CLBNode.is_done_draining` returns `True`.
     """
     node = CLBNode(node_id="1234", description=self.drain_desc, address="10.1.1.1", drained_at=0.0, connections=0)
     self.assertTrue(node.is_done_draining(now=15, timeout=30))
Exemple #3
0
 def test_not_done_draining_before_timeout_if_no_connection_info(self):
     """
     If connection information is not provided, and the node has been in
     draining less than the timeout, :func:`CLBNode.is_done_draining`
     returns `False`.
     """
     node = CLBNode(node_id="1234", description=self.drain_desc, address="10.1.1.1", drained_at=0.0)
     self.assertFalse(node.is_done_draining(now=15, timeout=30))
Exemple #4
0
 def test_done_draining_past_timeout_even_if_no_connection_info(self):
     """
     If connection information is not provided, and the node has been in
     draining past the timeout, :func:`CLBNode.is_done_draining` returns
     `True`.
     """
     node = CLBNode(node_id="1234", description=self.drain_desc, address="10.1.1.1", drained_at=0.0)
     self.assertTrue(node.is_done_draining(now=30, timeout=15))
Exemple #5
0
 def test_done_draining_before_timeout_if_there_are_no_connections(self):
     """
     If there are zero connections, but the node has been in draining less
     than the timeout, :func:`CLBNode.is_done_draining` returns `True`.
     """
     node = CLBNode(node_id='1234', description=self.drain_desc,
                    address='10.1.1.1', drained_at=0.0, connections=0)
     self.assertTrue(node.is_done_draining(now=15, timeout=30))
Exemple #6
0
 def test_done_draining_past_timeout_even_if_there_are_connections(self):
     """
     If there are still connections, but the node has been in draining past
     the timeout, :func:`CLBNode.is_done_draining` returns `True`.
     """
     node = CLBNode(node_id='1234', description=self.drain_desc,
                    address='10.1.1.1', drained_at=0.0, connections=1)
     self.assertTrue(node.is_done_draining(now=30, timeout=15))
Exemple #7
0
 def test_not_done_draining_before_timeout_if_no_connection_info(self):
     """
     If connection information is not provided, and the node has been in
     draining less than the timeout, :func:`CLBNode.is_done_draining`
     returns `False`.
     """
     node = CLBNode(node_id='1234', description=self.drain_desc,
                    address='10.1.1.1', drained_at=0.0)
     self.assertFalse(node.is_done_draining(now=15, timeout=30))
Exemple #8
0
 def test_done_draining_past_timeout_even_if_no_connection_info(self):
     """
     If connection information is not provided, and the node has been in
     draining past the timeout, :func:`CLBNode.is_done_draining` returns
     `True`.
     """
     node = CLBNode(node_id='1234', description=self.drain_desc,
                    address='10.1.1.1', drained_at=0.0)
     self.assertTrue(node.is_done_draining(now=30, timeout=15))