diff --git a/src/cloudai/_core/test_scenario.py b/src/cloudai/_core/test_scenario.py index b8bdded3a..82315fb7d 100644 --- a/src/cloudai/_core/test_scenario.py +++ b/src/cloudai/_core/test_scenario.py @@ -217,6 +217,10 @@ def apply_params_set(self, action: dict[str, Any], env_params: dict[str, Any] | for key, value in full_action.items(): if key.startswith("extra_env_vars."): tdef.extra_env_vars[key[len("extra_env_vars.") :]] = value + elif key == "NUM_NODES": + # Handled below via new_tr.num_nodes; cmd_args has no such field, and CmdArgs' + # extra="allow" would otherwise let this create a phantom attribute on it. + continue else: attrs = key.split(".") obj = tdef.cmd_args diff --git a/tests/test_cloudaigym.py b/tests/test_cloudaigym.py index c1d8c3153..174e7049a 100644 --- a/tests/test_cloudaigym.py +++ b/tests/test_cloudaigym.py @@ -335,6 +335,7 @@ def test_params_set(setup_env: tuple[TestRun, Runner], num_nodes: int): assert new_tr.test.extra_env_vars[key[len("extra_env_vars.") :]] == value elif key == "NUM_NODES": assert new_tr.num_nodes == value + assert "NUM_NODES" not in cmd_args else: assert cmd_args[key] == value