Skip to content

Commit

Permalink
chore: wait_for_task_state shows logs on failure (#10029)
Browse files Browse the repository at this point in the history
Before, it wasn't using the session to fetch logs.
  • Loading branch information
rb-determined-ai authored Oct 8, 2024
1 parent a166826 commit 9faa0cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion e2e_tests/tests/cluster/test_agent_disable.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def test_disable_agent_experiment_resume() -> None:
assert len(slots) == 1
agent_id = slots[0]["agent_id"]

# Make the experiment preemptible.
exp_ref = noop.create_experiment(sess, [noop.Sleep(100)], config={"max_restarts": 0})
exp.wait_for_experiment_state(
sess,
Expand Down
6 changes: 4 additions & 2 deletions e2e_tests/tests/cluster/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import copy
import datetime
import http.server
import subprocess
import sys
import threading
import time
from typing import Any, Dict, List, Optional, Tuple, Type
Expand Down Expand Up @@ -179,7 +179,9 @@ def wait_for_task_state(
return
time.sleep(1)

print(subprocess.check_output(["det", "-m", conf.make_master_url(), "task", "logs", task_id]))
print("== begin task logs ==", file=sys.stderr)
print(detproc.check_output(sess, ["det", "task", "logs", task_id]), file=sys.stderr)
print("== end task logs ==", file=sys.stderr)
pytest.fail(f"{task_type} expected {state} state got {gotten_state} instead after {ticks} secs")


Expand Down

0 comments on commit 9faa0cb

Please sign in to comment.