Skip to content

Commit

Permalink
Add test for bjobs output with exec_host split over two lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-eq committed Mar 22, 2024
1 parent 795982a commit eefa62c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit_tests/scheduler/test_lsf_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,15 @@ def test_parse_bjobs(job_id, username, job_state):
}


def test_parse_bjobs_handles_output_with_exec_host_split_over_two_lines():
bjobs_output = (
"JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME\n"
"479460 xxxx RUN allcpus foo-host-n1 3*foo-host1 FOO_00-0 Feb 14 13:07\n"
" 4*foo-hostn105-05-10"
)
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 eefa62c

Please sign in to comment.