'Updating config multiple times within a second only actually causes 1
update to be sent to the agent.'

def test_coalesced_sends_within_time(self):

    agent = FakeAgent()
    client = AgentAMP(Clock(), agent)
    service_clock = Clock()
    service = build_control_amp_service(self, service_clock)
    service.startService()
    server = LoopbackAMPClient(client.locator)
    service.connected(server)
    initial_updates_count = agent.cluster_updated_count
    for _ in xrange(10):
        service.configuration_service.save(arbitrary_transformation(_TEST_DEPLOYMENT))
    self.assertEqual((agent.cluster_updated_count - initial_updates_count), 0)
    service_clock.advance((CONTROL_SERVICE_BATCHING_DELAY * 2))
    self.assertEqual((agent.cluster_updated_count - initial_updates_count), 1)
