'When a convergence loop in the sleeping state receives a status update
the next iteration of the event loop uses it. The event loop is
not woken up if the update would not result in newly calculated
required actions.'

def test_convergence_iteration_status_update_no_consequences(self):

    loop = self.convergence_iteration(later_actions=[NO_OP, NO_OP])
    node_state = NodeState(hostname=u'192.0.3.5')
    changed_configuration = Deployment(nodes=frozenset([to_node(node_state)]))
    changed_state = DeploymentState(nodes=[node_state, self.local_state])
    loop.receive(_ClientStatusUpdate(client=self.make_amp_client([self.local_state]), configuration=changed_configuration, state=changed_state))
    num_calculations_pre_sleep = len(self.deployer.calculate_inputs)
    self.reactor.advance(_UNCONVERGED_DELAY)
    num_calculations_after_sleep = len(self.deployer.calculate_inputs)
    self.assertEqual(dict(pre=num_calculations_pre_sleep, post=num_calculations_after_sleep), dict(pre=2, post=3))
