diff --git a/lib/galaxy/tool_util/verify/interactor.py b/lib/galaxy/tool_util/verify/interactor.py index ca186d823ebb..e06b8322bc6f 100644 --- a/lib/galaxy/tool_util/verify/interactor.py +++ b/lib/galaxy/tool_util/verify/interactor.py @@ -1750,8 +1750,11 @@ def _get_test_name(test_dict: Union[ToolTestDict, ToolTestDescriptionDict], test return name -def _get_maxseconds(test_dict: Union[ToolTestDict, ToolTestDescriptionDict]) -> int: - return int(cast(Union[str, int], test_dict.get("maxseconds") or DEFAULT_TOOL_TEST_WAIT or 86400)) +def _get_maxseconds(test_dict: Union[ToolTestDict, ToolTestDescriptionDict]) -> Optional[int]: + maxseconds = test_dict.get("maxseconds") + if maxseconds is None: + return maxseconds + return maxseconds def expanded_inputs_from_json(expanded_inputs_json: ExpandedToolInputsJsonified) -> ExpandedToolInputs: @@ -1839,31 +1842,31 @@ def test_data(self): def to_dict(self) -> ToolTestDescriptionDict: inputs = expanded_inputs_to_json(self.inputs) - return ToolTestDescriptionDict( - { - "inputs": inputs, - "outputs": self.outputs, - "output_collections": [_.to_dict() for _ in self.output_collections], - "num_outputs": self.num_outputs, - "command_line": self.command_line, - "command_version": self.command_version, - "stdout": self.stdout, - "stderr": self.stderr, - "expect_exit_code": self.expect_exit_code, - "expect_failure": self.expect_failure, - "expect_test_failure": self.expect_test_failure, - "name": self.name, - "test_index": self.test_index, - "tool_id": self.tool_id, - "tool_version": self.tool_version, - "required_files": self.required_files, - "required_data_tables": self.required_data_tables, - "required_loc_files": self.required_loc_files, - "error": self.error, - "exception": self.exception, - "maxseconds": self.maxseconds, - } - ) + test_description_def: ToolTestDescriptionDict = { + "inputs": inputs, + "outputs": self.outputs, + "output_collections": [_.to_dict() for _ in self.output_collections], + "num_outputs": self.num_outputs, + "command_line": self.command_line, + "command_version": self.command_version, + "stdout": self.stdout, + "stderr": self.stderr, + "expect_exit_code": self.expect_exit_code, + "expect_failure": self.expect_failure, + "expect_test_failure": self.expect_test_failure, + "name": self.name, + "test_index": self.test_index, + "tool_id": self.tool_id, + "tool_version": self.tool_version, + "required_files": self.required_files, + "required_data_tables": self.required_data_tables, + "required_loc_files": self.required_loc_files, + "error": self.error, + "exception": self.exception, + } + if self.maxseconds is not None: + test_description_def["maxseconds"] = self.maxseconds + return ToolTestDescriptionDict(test_description_def) def test_data_iter(required_files):