Skip to content

Commit

Permalink
Fix planemo timeout handling
Browse files Browse the repository at this point in the history
Planemo calls `verify_tool` with a maxseconds value,
and then sets `tool_test_dict.setdefault("maxseconds", maxseconds)`,
which fails, since we are serializing and already setting the default
maxseconds while parsing the test dict.

Fixes the IUC tool test timeouts not working when testing against 24.2.
  • Loading branch information
mvdbeek committed Jan 8, 2025
1 parent 962839d commit 93280da
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions lib/galaxy/tool_util/verify/interactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 93280da

Please sign in to comment.