mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 12:13:33 +08:00
Redirect stderr of trap cleanup
Prevents ``` rm: cannot remove '/data/jwd/main/046/709/46709070/tmp/out.471762': No such file or directory rm: cannot remove '/data/jwd/main/046/709/46709070/tmp/err.471762': No such file or directory ``` reported in https://github.com/galaxyproject/galaxy/issues/13902. I don't think this is what fails the job, there is likely something else wrong on top of this.
This commit is contained in:
@@ -282,7 +282,7 @@ class CommandsBuilder:
|
||||
if TRAP_KILL_CONTAINER in self.commands:
|
||||
# We need to replace the container kill trap with one that removes the named pipes and kills the container
|
||||
self.commands = self.commands.replace(TRAP_KILL_CONTAINER, "")
|
||||
trap_command = """trap 'rm "$__out" "$__err"; _on_exit' EXIT"""
|
||||
trap_command = """trap 'rm "$__out" "$__err" 2> /dev/null || true; _on_exit' EXIT"""
|
||||
self.prepend_command(
|
||||
f"""__out="${{TMPDIR:-.}}/out.$$" __err="${{TMPDIR:-.}}/err.$$"
|
||||
mkfifo "$__out" "$__err"
|
||||
|
||||
@@ -54,7 +54,7 @@ class TestCommandFactory(TestCase):
|
||||
self.job_wrapper.command_line = f"{TRAP_KILL_CONTAINER}{MOCK_COMMAND_LINE}"
|
||||
expected_command_line = self._surround_command(MOCK_COMMAND_LINE).replace(
|
||||
"""trap 'rm "$__out" "$__err"' EXIT""",
|
||||
"""trap 'rm "$__out" "$__err"; _on_exit' EXIT"""
|
||||
"""trap 'rm "$__out" "$__err" 2> /dev/null || true; _on_exit' EXIT"""
|
||||
)
|
||||
self.__assert_command_is(expected_command_line)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user