def test_kubernetes_cancel_after_ttl(
    k8s_dispatcher: KubernetesDispatcher,
    benchmark_event_dummy_payload: BenchmarkEvent,
    k8s_test_client: KubernetesTestUtilsClient,
    fetcher_job_config: FetcherJobConfig,
):
    # No dispatch - should not throw
    k8s_dispatcher.cancel_all(benchmark_event_dummy_payload.client_id, benchmark_event_dummy_payload.action_id)
Example #2
0
def test_cancel_all_actions(
    k8s_dispatcher: KubernetesDispatcher,
    mock_batch_api_instance: kubernetes.client.BatchV1Api,
    mock_core_api_instance: kubernetes.client.CoreV1Api,
    mock_k8s_config,
):
    k8s_dispatcher.cancel_all(CLIENT_ID)

    _verify_k8s_all_delete(mock_batch_api_instance, mock_core_api_instance)
def test_kubernetes_cancel(
    k8s_dispatcher: KubernetesDispatcher,
    benchmark_event_dummy_payload: BenchmarkEvent,
    k8s_test_client: KubernetesTestUtilsClient,
    fetcher_job_config: FetcherJobConfig,
    size_info: ContentSizeInfo,
):
    data_set = DownloadableContent(
        src=SOMEDATA_BIG_WITH_DELAY, path="/mount/path", dst=S3_DST, md5=None, size_info=size_info
    )
    k8s_dispatcher.dispatch_fetch(data_set, benchmark_event_dummy_payload, "/data/sets/fake")

    _wait_for_k8s_objects_exist(benchmark_event_dummy_payload, fetcher_job_config, k8s_test_client, size_info)

    k8s_dispatcher.cancel_all(benchmark_event_dummy_payload.client_id, benchmark_event_dummy_payload.action_id)

    _wait_for_k8s_objects_deleted(benchmark_event_dummy_payload, fetcher_job_config, k8s_test_client, size_info)