diff --git a/tests/integration_tests/scheduler/test_lsf_driver.py b/tests/integration_tests/scheduler/test_lsf_driver.py index ad26c898d3a..60176830ce6 100644 --- a/tests/integration_tests/scheduler/test_lsf_driver.py +++ b/tests/integration_tests/scheduler/test_lsf_driver.py @@ -183,13 +183,17 @@ async def test_submit_with_num_cpu(pytestconfig, job_name): process = await asyncio.create_subprocess_exec( "bhist", + "-l", job_id, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, ) - stdout, _ = await process.communicate() - matches = re.search(".*([0-9]+) Processors Requested", stdout.decode()) - assert matches and matches[1] == num_cpu + stdout, stderr = await process.communicate() + stdout_no_whitespaces = re.sub(r"\s+", "", stdout.decode()) + matches = re.search(r".*([0-9]+)ProcessorsRequested.*", stdout_no_whitespaces) + assert matches and matches[1] == str( + num_cpu + ), f"Could not verify processor allocation from stdout: {stdout}, stderr: {stderr}" assert Path("test").read_text(encoding="utf-8") == "test\n"