Skip to content

Commit

Permalink
fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinaecalderon committed Jul 30, 2024
1 parent eb02544 commit 918bb13
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions e2e_tests/tests/cluster/test_experiment_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 918bb13

Please sign in to comment.