diff --git a/tests/ert/unit_tests/scheduler/test_lsf_driver.py b/tests/ert/unit_tests/scheduler/test_lsf_driver.py index 51167bcbce3..de46f623c38 100644 --- a/tests/ert/unit_tests/scheduler/test_lsf_driver.py +++ b/tests/ert/unit_tests/scheduler/test_lsf_driver.py @@ -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)