def METHOD_NAME(stub_broker, stub_worker, cancel_backend, with_pipeline):
    # Given a cancel backend
    # And a broker with the cancel middleware
    stub_broker.add_middleware(Cancel(backend=cancel_backend))
    has_been_called = []
    # And an actor
    @remoulade.actor()
    def do_work():
        has_been_called.append(1)
        raise ValueError()
    # And this actor is declared
    stub_broker.declare_actor(do_work)
    if with_pipeline:
        g = pipeline(do_work.message() for _ in range(4))
    else:
        g = group(do_work.message() for _ in range(4))
    g.cancel()
    g.run()
    stub_broker.join(do_work.queue_name)
    stub_worker.join()
    # All actors should have been canceled
    assert all(cancel_backend.is_canceled(child.message_id, None) for child in g.children)
    assert len(has_been_called) == 0