'CreateDataset probe waits for cluster to converge.'

@capture_logging(None)
def test_create_dataset(self, logger):

    clock = Clock()
    node_id = uuid4()
    node = Node(uuid=node_id, public_address=IPAddress('10.0.0.1'))
    control_service = FakeFlockerClient([node], node_id)
    cluster = BenchmarkCluster(IPAddress('10.0.0.1'), (lambda reactor: control_service), {}, None)
    operation = CreateDataset(clock, cluster)
    d = operation.get_probe()
    def run_probe(probe):
        def cleanup(result):
            cleaned_up = probe.cleanup()
            cleaned_up.addCallback((lambda _ignored: result))
            return cleaned_up
        d = probe.run()
        d.addCallback(cleanup)
        return d
    d.addCallback(run_probe)
    clock.advance(1)
    self.assertNoResult(d)
    control_service.synchronize_state()
    clock.advance(1)
    self.successResultOf(d)
