Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce Default TaskRun Timeout #871

Merged
merged 1 commit into from May 16, 2019
Merged

Enforce Default TaskRun Timeout #871

merged 1 commit into from May 16, 2019

Conversation

ghost
Copy link

@ghost ghost commented May 16, 2019

Changes

The TaskRun spec describes a default timeout of ten minutes but this isn't documented anywhere else or enforced by the TaskRun reconciler.

This commit:

  • updates the docs for TaskRuns to make the default timeout clear for users
  • changes the taskrun reconciler to use the default timeout if one isn't specified in the TaskRun yaml

Before, TaskRuns don't timeout after ten minutes:

2019-05-16_11-16-21

After, TaskRuns timeout after ten minutes by default:

2019-05-16_12-45-15

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

Release Notes

TaskRuns will now time out by default after ten minutes. This behaviour was previously documented as part of the TaskRun spec but not enforced; now it will also be enforced.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label May 16, 2019
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 16, 2019
@ghost ghost changed the title Enforce Default TaskRun Timeout WIP Enforce Default TaskRun Timeout May 16, 2019
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 16, 2019
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me !

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 16, 2019
@ghost
Copy link
Author

ghost commented May 16, 2019

Making this WIP just while I wip up a unit test.

test added

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 16, 2019
@ghost ghost changed the title WIP Enforce Default TaskRun Timeout Enforce Default TaskRun Timeout May 16, 2019
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 16, 2019
The TaskRun spec describes a default timeout of ten minutes but this
isn't documented anywhere else or enforced by the TaskRun reconciler.

This commit:
- updates the docs for TaskRuns to make the default timeout clear for users
- changes the taskrun reconciler to use the default timeout if one isn't
specified in the TaskRun yaml
- adds a test to check whether the taskrun reconciler's checkTimeout()
function is failing taskruns running longer than 10 minutes
@@ -1289,7 +1289,7 @@ func TestReconcileOnCompletedTaskRun(t *testing.T) {
if err != nil {
t.Fatalf("Expected completed TaskRun %s to exist but instead got error when getting it: %v", taskRun.Name, err)
}
if d := cmp.Diff(newTr.Status.GetCondition(apis.ConditionSucceeded), taskSt, ignoreLastTransitionTime); d != "" {
if d := cmp.Diff(taskSt, newTr.Status.GetCondition(apis.ConditionSucceeded), ignoreLastTransitionTime); d != "" {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tweaked this and line 1328 because the -want, +got results were backwards.

@dibyom
Copy link
Member

dibyom commented May 16, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 16, 2019
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom, sbwsg, vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot merged commit 4d1980f into tektoncd:master May 16, 2019
@ghost ghost deleted the enforce-default-taskrun-timeout branch May 17, 2019 12:29
bobcatfish added a commit to bobcatfish/pipeline that referenced this pull request Aug 19, 2019
Scott has been provided super detailed helpful reviews for a while now
(58 reviews as of
https://tekton.devstats.cd.foundation/d/46/pr-reviews-by-contributor?orgId=1&var-period=d&var-repo_name=tektoncd%2Fpipeline&var-reviewers="sbwsg").

He has contributed useful and technically challenging features such as
tektoncd#905 (recreate pods in face of
ResourceQuota errors), drove completion of
tektoncd#936
(Graceful sidecar support) and also tektoncd#871
(enforcing default TaskRun timeouts).
@bobcatfish bobcatfish mentioned this pull request Aug 19, 2019
1 task
tekton-robot pushed a commit that referenced this pull request Aug 26, 2019
Scott has been provided super detailed helpful reviews for a while now
(58 reviews as of
https://tekton.devstats.cd.foundation/d/46/pr-reviews-by-contributor?orgId=1&var-period=d&var-repo_name=tektoncd%2Fpipeline&var-reviewers="sbwsg").

He has contributed useful and technically challenging features such as
#905 (recreate pods in face of
ResourceQuota errors), drove completion of
#936
(Graceful sidecar support) and also #871
(enforcing default TaskRun timeouts).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants