diff --git a/e2e_tests/tests/cluster/test_experiment_delete.py b/e2e_tests/tests/cluster/test_experiment_delete.py index e64ec4bc86ca..e29d95e2132b 100644 --- a/e2e_tests/tests/cluster/test_experiment_delete.py +++ b/e2e_tests/tests/cluster/test_experiment_delete.py @@ -51,30 +51,26 @@ def test_delete_experiment_removes_tensorboard_files() -> None: pytest.fail(f"experiment failed to be deleted after {ticks} seconds") -@pytest.mark.e2e_k8s +@pytest.mark.e2e_single_k8s def test_cancel_experiment_remove_k8s_pod() -> None: # Start a random experiment. sess = api_utils.user_session() - config_obj = conf.load_config(conf.fixtures_path("no_op/single-medium-train-step.yaml")) - experiment_id = exp.run_basic_test_with_temp_config( - sess, config_obj, conf.fixtures_path("no_op"), 1 + + experiment_id = exp.create_experiment( + sess, + conf.fixtures_path("no_op/single-one-short-step.yaml"), + conf.fixtures_path("no_op"), + ) + exp.wait_for_experiment_state( + sess, + experiment_id, + bindings.experimentv1State.RUNNING, + max_wait_secs=60, ) # Find the trial, and kill the pod. - cmd = [ - "kubectl", - "delete", - "$(", - "kubectl", - "get", - "pods" "name", - "|", - "grep", - "-i", - "exp-" + str(experiment_id), - ")", - ] - subprocess.check_call(cmd) + cmd = f'kubectl delete $(kubectl get pods -o name | grep -i "exp-{experiment_id}")' + subprocess.run(cmd, shell=True) # Cancel the experiment command = ["det", "-m", conf.make_master_url(), "e", "cancel", str(experiment_id)]