Skip to content

Commit

Permalink
Merge pull request #478 from dodona-edu/fix/b
Browse files Browse the repository at this point in the history
Fix bug for stdout/stderrr on timeouts
  • Loading branch information
niknetniko authored Dec 1, 2023
2 parents 20c2fdf + 1a9b382 commit 1a0a90f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tested/judge/planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class PlannedExecutionUnit:
index: int

def get_stdin(self, resources: Path) -> str:
return "\n".join(c.context.get_stdin(resources) or "" for c in self.contexts)
potential = [c.context.get_stdin(resources) for c in self.contexts]
return "\n".join(p for p in potential if p)

def has_main_testcase(self) -> bool:
return self.contexts[0].context.has_main_testcase()
Expand Down
4 changes: 2 additions & 2 deletions tested/judge/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def run_command(
)
except subprocess.TimeoutExpired as e:
return BaseExecutionResult(
stdout=str(e.stdout or ""),
stderr=str(e.stderr or ""),
stdout=e.stdout.decode("utf-8", "backslashreplace") if e.stdout else "",
stderr=e.stderr.decode("utf-8", "backslashreplace") if e.stderr else "",
exit=0,
timeout=True,
memory=False,
Expand Down

0 comments on commit 1a0a90f

Please sign in to comment.