Skip to content

Commit

Permalink
adding first version of timeout to the execution for lxc
Browse files Browse the repository at this point in the history
  • Loading branch information
ooemperor committed Jun 23, 2024
1 parent 1fe3550 commit 157d1e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions codeGrader/backend/execution/Execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ def execute(self) -> None:

start_time = time.time()

output, returncode = self.lxc.lxc_execute_command(
f"python3 {config.executionFilePath}/{script_filename_hash} < {config.executionFilePath}/{testcase_file_hash}") # TODO make better execution function. Not allowed to be hardcoded
command = f"timeout 30s python3 {config.executionFilePath}/{script_filename_hash} < {config.executionFilePath}/{testcase_file_hash}"

output, returncode = self.lxc.lxc_execute_command(command) # TODO make better execution function. Not allowed to be hardcoded

end_time = time.time()

Expand Down

0 comments on commit 157d1e6

Please sign in to comment.