'If multiple clients still haven\'t acknowledged an update when a
broadcast is done, then they should just queue their update for the
next batch rather than immediately sending a response.'

def test_coalesce_delayed_updates(self):

    agents = list((FakeAgent() for _ in xrange(10)))
    clients = list((AgentAMP(Clock(), agent) for agent in agents))
    service_clock = Clock()
    service = build_control_amp_service(self, service_clock)
    service.startService()
    servers = list((LoopbackAMPClient(client.locator) for client in clients))
    delayed_servers = list((DelayedAMPClient(server) for server in servers))
    for server in delayed_servers:
        service.connected(server)
    service_clock.advance((CONTROL_SERVICE_BATCHING_DELAY * 2))
    (server.respond() for server in delayed_servers)
    configuration = service.configuration_service.get()
    service.configuration_service.save(arbitrary_transformation(configuration))
    service_clock.advance((CONTROL_SERVICE_BATCHING_DELAY * 2))
    final_configuration = arbitrary_transformation(configuration)
    service.configuration_service.save(final_configuration)
    service_clock.advance((CONTROL_SERVICE_BATCHING_DELAY * 2))
    initial_update_counts = list((agent.cluster_updated_count for agent in agents))
    for server in delayed_servers:
        server.respond()
        service_clock.advance(0.001)
    self.assertEqual(([0] * len(agents)), list(((agent.cluster_updated_count - c) for (agent, c) in zip(agents, initial_update_counts))))
    service_clock.pump(([(CONTROL_SERVICE_BATCHING_DELAY * 2)] * 10))
    self.assertEqual(([1] * len(agents)), list(((agent.cluster_updated_count - c) for (agent, c) in zip(agents, initial_update_counts))))
    self.assertEqual(([final_configuration] * len(agents)), list((agent.desired for agent in agents)))
