Skip to content

Commit

Permalink
chore: improve messaging for e2e tests (#9286)
Browse files Browse the repository at this point in the history
  • Loading branch information
eecsliu authored May 3, 2024
1 parent 0aef4c7 commit e90bd0d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion e2e_tests/tests/cluster/managed_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ def restart_proxy(self, wait_for_reconnect: bool = True) -> None:
def ensure_agent_ok(self) -> None:
sess = api_utils.user_session()
agent_data = get_agent_data(sess)
assert len(agent_data) == 1
assert (
len(agent_data) == 1
), f"expected agent_data for 1, instead found {len(agent_data)} agents:\n{agent_data}\n"
assert agent_data[0]["enabled"] is True
assert agent_data[0]["draining"] is False

Expand Down
6 changes: 3 additions & 3 deletions e2e_tests/tests/cluster/test_rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ def create_workspaces_with_users(
Set up workspaces and users with the provided role assignments.
For example the following sets up 2 workspaces and 2 users referenced
with the integer ids 1 and 2. User 1 has the roles Editor and Viewer on
workspace 1 and the role Viewer on workspace 2. User 2 has the role Viewer
on workspace 1 and no roles on workspace 2.
workspace 1 and workspace 2. User 2 has the role Viewer on workspace 1
and no roles on workspace 2.
perm_assigments = [
[
(1, ["Editor", "Viewer"]),
(2, ["Viewer"]),
],
[
(1, ["Viewer"]),
(1, ["Editor", "Viewer"]),
]
]
"""
Expand Down
5 changes: 2 additions & 3 deletions e2e_tests/tests/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,12 @@ def wait_for_experiment_workload_progress(
def experiment_has_completed_workload(sess: api.Session, experiment_id: int) -> bool:
trials = experiment_trials(sess, experiment_id)

if not any(trials):
return False

for t in trials:
for s in t.workloads:
if s.training is not None or s.validation is not None:
return True
print(f"trial for experiment {experiment_id} is in the {t.trial.state} state")

return False


Expand Down

0 comments on commit e90bd0d

Please sign in to comment.