'Stopping the service cancels any delayed updates'

def test_stop_service_delayed(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_update_counts = agent.cluster_updated_count
    service.configuration_service.save(_TEST_DEPLOYMENT)
    service.stopService()
    service_clock.advance((CONTROL_SERVICE_BATCHING_DELAY * 2))
    self.assertEqual(0, (agent.cluster_updated_count - initial_update_counts))
