mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-10-15 19:42:06 +00:00
fix: enforce job.<job-id>.timeout-minutes (#982)
- enforce timeout-minutes timeout for jobs in a way similar to how it is done for steps - minimal refactor of evaluateStepTimeout evaluateTimeout so it can be used by jobs as well, with additional debug information and error logging if parsing fails - add integration tests for both step and job timeout-minutes, verifying expressions are allowed and evaluated Resolves forgejo/runner#979 --- Manually verified to work as expected https://v13.next.forgejo.org/earl-warren/testtimeout-minutes/actions/runs/3/jobs/0/attempt/1 ```yaml on: [push] jobs: test: runs-on: docker timeout-minutes: 1 steps: - run: | set -x while : ; do sleep 30 done ```  <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/982): <!--number 982 --><!--line 0 --><!--description Zml4OiBlbmZvcmNlIGpvYi48am9iLWlkPi50aW1lb3V0LW1pbnV0ZXM=-->fix: enforce job.<job-id>.timeout-minutes<!--description--> <!--end release-notes-assistant--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/982 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
933667bdf1
commit
02a51c0a21
6 changed files with 39 additions and 6 deletions
|
@ -272,6 +272,8 @@ func TestRunner_RunEvent(t *testing.T) {
|
|||
{workdir, "evalmatrix-merge-array", "push", "", platforms, secrets},
|
||||
|
||||
{workdir, "basic", "push", "", platforms, secrets},
|
||||
{workdir, "timeout-minutes-stop", "push", "Job 'check' failed", platforms, secrets},
|
||||
{workdir, "timeout-minutes-job", "push", "context deadline exceeded", platforms, secrets},
|
||||
{workdir, "fail", "push", "Job 'build' failed", platforms, secrets},
|
||||
{workdir, "runs-on", "push", "", platforms, secrets},
|
||||
{workdir, "checkout", "push", "", platforms, secrets},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue