Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix in job completion checks #340

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cloudai/report_generator/report_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _generate_test_report(self, directory_path: Path, tr: TestRun) -> None:
continue
if not tr.test.test_template.can_handle_directory(subdir):
logging.warning(
f"Skipping '{subdir}', can't hande with "
f"Skipping '{subdir}', can't handle with "
f"strategy={tr.test.test_template.report_generation_strategy}."
)
continue
Expand Down
3 changes: 3 additions & 0 deletions src/cloudai/systems/slurm/slurm_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ def is_job_completed(self, job: BaseJob, retry_threshold: int = 3) -> bool:
raise RuntimeError(error_message)

job_states = stdout.strip().split()
if "RUNNING" in job_states:
return False

if any(state in ["COMPLETED", "FAILED", "CANCELLED", "TIMEOUT"] for state in job_states):
return True

Expand Down
3 changes: 3 additions & 0 deletions tests/test_slurm_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ def test_allocate_nodes_exceeding_limit(
("TIMEOUT", "", True),
("RUNNING", "", False),
("PENDING", "", False),
("COMPLETED RUNNING", "", False),
("RUNNING COMPLETED", "", False),
("COMPLETED COMPLETED", "", True),
("", "error", False),
],
)
Expand Down
Loading