Skip to content

Commit

Permalink
Merge pull request #88 from Nikita-Barabanov/main
Browse files Browse the repository at this point in the history
Add log for runtime/validate crashes, test fix
  • Loading branch information
FrBrGeorge authored Oct 20, 2023
2 parents 04470d2 + 6783d27 commit f4aa7fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions hworker/check/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ def python_runner(
)
except TimeoutExpired as time_error:
result = CompletedProcess(time_error.args, -1, stderr=str(time_error).encode(errors="replace"))
except Exception as error:
get_logger(__name__).warning(f"Runner {prog_path} crashed on {input_path} data:\n {error}")

exit_code = result.wait()
with open(prog_output.name, "rb") as po:
po = po.read()
Expand Down
1 change: 1 addition & 0 deletions hworker/check/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def validate_wo_store(validator: Check, solution: Solution, check_num: int = 0)
else:
result = v(search(Solution, Criteria("ID", "==", solution.ID)), *validator_args)
except Exception as error:
get_logger(__name__).warning(f"Validator {validator.ID} crashed on {solution.ID} solution:\n {error}")
stderr = str(error).encode()
finally:
module_path.unlink(missing_ok=True)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_git_users(self, user_config):

@pytest.mark.parametrize(
"user_config",
[{"tasks": {"task_ID": {"deliver_ID": "20230101/01", "open_date": datetime(year=2023, month=1, day=1)}}}],
[{"tasks": {"task_ID": {"deliver_ID": "20230101/01", "open_date": datetime(year=2023, month=1, day=1, hour=DAY_START)}}}],
indirect=True,
)
def test_task_info(self, user_config):
Expand Down

0 comments on commit f4aa7fa

Please sign in to comment.