From c930d3de02bc3f770674a6c8797bda69ade2f0d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Thu, 9 Jan 2025 08:52:14 +0100 Subject: [PATCH] wip: non-working test --- src/ert/scheduler/lsf_driver.py | 1 + tests/ert/unit_tests/scheduler/test_lsf_driver.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/ert/scheduler/lsf_driver.py b/src/ert/scheduler/lsf_driver.py index a2618cff6cd..53155e25b27 100644 --- a/src/ert/scheduler/lsf_driver.py +++ b/src/ert/scheduler/lsf_driver.py @@ -435,6 +435,7 @@ async def poll(self) -> None: current_jobids = list(self._jobs.keys()) try: + print("POLLLING BJOBS") process = await asyncio.create_subprocess_exec( str(self._bjobs_cmd), "-noheader", diff --git a/tests/ert/unit_tests/scheduler/test_lsf_driver.py b/tests/ert/unit_tests/scheduler/test_lsf_driver.py index 7064748a99b..2941d4a6581 100644 --- a/tests/ert/unit_tests/scheduler/test_lsf_driver.py +++ b/tests/ert/unit_tests/scheduler/test_lsf_driver.py @@ -1269,6 +1269,20 @@ def mock_poll_once_by_bhist(*args, **kwargs): assert job_id in driver._bhist_cache +@pytest.mark.integration_test +async def test_no_exception_when_bjobs_does_not_exist(caplog, job_name): + caplog.set_level(logging.DEBUG) + driver = LsfDriver( + bjobs_cmd="/bin_foo/not_existing", bhist_cmd="/bin_bar/not_existing" + ) + driver._poll_period = 0.01 + await driver.submit(0, "sh", "-c", "sleep 1", name=job_name) + await poll(driver, {0}) + print("waiting..") + await asyncio.sleep(1) + print(caplog.text) + + @pytest.mark.integration_test async def test_that_kill_before_submit_is_finished_works(tmp_path, monkeypatch, caplog): """This test asserts that it is possible to issue a kill command