Skip to content

Commit

Permalink
Add test for bjobs output with no exec_host
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-eq committed Mar 22, 2024
1 parent eefa62c commit 39dbee1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/unit_tests/scheduler/test_lsf_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,14 @@ def test_parse_bjobs_handles_output_with_exec_host_split_over_two_lines():
assert parse_bjobs(bjobs_output) == {"jobs": {"479460": {"job_state": "RUN"}}}


def test_parse_bjobs_handles_output_with_no_exec_host():
bjobs_output = (
"JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME\n"
"479460 xxxx RUN allcpus foo-host-n1 FOO_00-0 Feb 14 13:07\n"
)
assert parse_bjobs(bjobs_output) == {"jobs": {"479460": {"job_state": "RUN"}}}


@given(nonempty_string_without_whitespace().filter(lambda x: x not in valid_jobstates))
def test_parse_bjobs_invalid_state_is_ignored(random_state):
assert parse_bjobs(f"1 _ {random_state}") == {"jobs": {}}
Expand Down

0 comments on commit 39dbee1

Please sign in to comment.