Skip to content

Commit

Permalink
Fix general queue options not being added bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-eq committed Sep 3, 2024
1 parent de9d63a commit 708cf2b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/unit_tests/config/test_ert_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1644,3 +1644,45 @@ def test_that_empty_params_file_gives_reasonable_error(tmpdir, param_config):

with pytest.raises(ConfigValidationError, match="No parameters specified in"):
ErtConfig.from_file("config.ert")


@pytest.mark.usefixtures("use_tmpdir")
@pytest.mark.parametrize(
"max_running_queue_config_entry",
[
pytest.param(
"""
MAX_RUNNING 6
QUEUE_OPTION LSF MAX_RUNNING 2
QUEUE_OPTION SLURM MAX_RUNNING 2
""",
id="general_keyword_max_running",
),
pytest.param(
"""
QUEUE_OPTION TORQUE MAX_RUNNING 6
MAX_RUNNING 2
""",
id="queue_option_max_running",
),
],
)
def test_queue_config_general_max_running_takes_precedence_over_queue_option(
max_running_queue_config_entry,
):
test_config_file_base = "test"
test_config_file_name = f"{test_config_file_base}.ert"
test_config_contents = dedent(
f"""
NUM_REALIZATIONS 100
DEFINE <STORAGE> storage/<CONFIG_FILE_BASE>-<DATE>
RUNPATH <STORAGE>/runpath/realization-<IENS>/iter-<ITER>
ENSPATH <STORAGE>/ensemble
QUEUE_SYSTEM TORQUE
{max_running_queue_config_entry}
"""
)
with open(test_config_file_name, "w", encoding="utf-8") as fh:
fh.write(test_config_contents)
config = ErtConfig.from_file(test_config_file_name)
assert config.queue_config.max_running == 6

0 comments on commit 708cf2b

Please sign in to comment.