Skip to content

Commit

Permalink
Resolve flakyness in test_kill_before_submit
Browse files Browse the repository at this point in the history
Sometimes the job actually starts on a compute node and sometimes
it does not before it is removed/killed. In the the latter case, code
previous to this commit will fail as it asserts that the job script
has actually started to run.
  • Loading branch information
berland committed Oct 4, 2024
1 parent 8e0afc1 commit 5087169
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/ert/unit_tests/scheduler/test_lsf_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,10 @@ async def finished(iens: int, returncode: int):
# detail we do not want to track.
assert returncode in (SIGTERM, SIGNAL_OFFSET + SIGTERM, LSF_FAILED_JOB)

if returncode != LSF_FAILED_JOB:
# We will only see the was_killed file if a compute node
# got a chance to start to job script:
wait_until((tmp_path / "was_killed").exists, timeout=4)

await poll(driver, {0}, finished=finished)
assert "ERROR" not in str(caplog.text)

wait_until((tmp_path / "was_killed").exists, timeout=10)

0 comments on commit 5087169

Please sign in to comment.