Пример #1
0
def test_cancel_future_after_shutdown_no_wait():
    bpe = BatchPoolExecutor(project='hail-vdc')
    future = bpe.submit(sleep_forever)
    bpe.shutdown(wait=False)
    was_cancelled = future.cancel()
    assert was_cancelled
    assert future.cancelled()
Пример #2
0
def test_cancel_future_after_shutdown_no_wait():
    bpe = BatchPoolExecutor(project='hail-vdc', image=PYTHON_DILL_IMAGE)
    def sleep_forever():
        while True:
            time.sleep(3600)

    future = bpe.submit(sleep_forever)
    bpe.shutdown(wait=False)
    was_cancelled = future.cancel()
    assert was_cancelled
    assert future.cancelled()