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

TaskRun emits no event when it fails on timeout #2328

Closed
afrittoli opened this issue Apr 5, 2020 · 3 comments · Fixed by #2329
Closed

TaskRun emits no event when it fails on timeout #2328

afrittoli opened this issue Apr 5, 2020 · 3 comments · Fixed by #2329
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@afrittoli
Copy link
Member

afrittoli commented Apr 5, 2020

Expected Behavior

When the task finishes, even in case of timeout, an event is emitted.

Actual Behavior

There's no event generated

Status:
  Completion Time:  2020-04-05T09:21:31Z
  Conditions:
    Last Transition Time:  2020-04-05T09:21:31Z
    Message:               TaskRun "taskrun-that-runs-for-longz4wqz" failed to finish within "30s"
    Reason:                TaskRunTimeout
    Status:                False
    Type:                  Succeeded
  Pod Name:                taskrun-that-runs-for-longz4wqz-pod-lm8lx
  Start Time:              2020-04-05T09:21:01Z
  Steps:
    Container:  step-this-step-does-something-it-sleeps-30-seconds
    Image ID:   docker.io/library/busybox@sha256:b26cd013274a657b86e706210ddd5cc1f82f50155791199d29b9e86e935ce135
    Name:       this-step-does-something-it-sleeps-30-seconds
    Running:
      Started At:  2020-04-05T09:21:06Z
    Container:     step-fail
    Image ID:      docker.io/library/busybox@sha256:b26cd013274a657b86e706210ddd5cc1f82f50155791199d29b9e86e935ce135
    Name:          fail
    Running:
      Started At:  2020-04-05T09:21:07Z
    Container:     step-never-runs
    Image ID:      docker.io/library/busybox@sha256:b26cd013274a657b86e706210ddd5cc1f82f50155791199d29b9e86e935ce135
    Name:          never-runs
    Running:
      Started At:  2020-04-05T09:21:07Z
Events:
  Type    Reason   Age   From                Message
  ----    ------   ----  ----                -------
  Normal  Started  110s  taskrun-controller

Steps to Reproduce the Problem

  1. TaskRun:
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
  generateName: taskrun-that-runs-for-long
spec:
  timeout: 30s
  taskSpec:
    steps:
    - name: this-step-sleeps-for-10m
      image: busybox
      script: |
        #!/bin/sh
        set -ex
        echo "Wait for a bit"
        sleep 600

Additional Info

  • Kubernetes version:
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T23:41:55Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.11+IKS", GitCommit:"0562ba8a2dfdd05f7f8721ab4952c02fe1605860", GitTreeState:"clean", BuildDate:"2020-03-13T14:45:42Z", GoVersion:"go1.12.17", Compiler:"gc", Platform:"linux/amd64"}
  • Tekton Pipeline version:

master, after v0.11.0

@afrittoli
Copy link
Member Author

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 5, 2020
@afrittoli
Copy link
Member Author

/assign

afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 5, 2020
Start emitting events for additional TaskRun lifecyle events:
- taskrun started
- taskrun timeout

Introduce pre-run and post-run functions that are invoked
asynchronously when the taskrun starts and completes, to emit
events.

These same functions shall be used to trigger any other async
behaviour on start/stop of taskruns.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 5, 2020
Start emitting events for additional TaskRun lifecyle events:
- taskrun started
- taskrun timeout

Introduce pre-run and post-run functions that are invoked
asynchronously when the taskrun starts and completes, to emit
events.

These same functions shall be used to trigger any other async
behaviour on start/stop of taskruns.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 9, 2020
Start emitting events for additional TaskRun lifecyle events:
- taskrun started
- taskrun timeout

Introduce pre-run and post-run functions that are invoked
asynchronously when the taskrun starts and completes, to emit
events.

These same functions shall be used to trigger any other async
behaviour on start/stop of taskruns.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 16, 2020
Start emitting events for additional TaskRun lifecyle events:
- taskrun started
- taskrun timeout

Introduce pre-run and post-run functions that are invoked
asynchronously when the taskrun starts and completes, to emit
events.

These same functions shall be used to trigger any other async
behaviour on start/stop of taskruns.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 16, 2020
Start emitting events for additional TaskRun lifecyle events:
- taskrun started
- taskrun timeout

Introduce pre-run and post-run functions that are invoked
asynchronously when the taskrun starts and completes, to emit
events.

These same functions shall be used to trigger any other async
behaviour on start/stop of taskruns.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 26, 2020
Emit events for additional TaskRun lifecyle events:
- taskrun started
- taskrun timeout

Introduce pre-run and post-run functions that are invoked
asynchronously when the taskrun starts and completes, to emit
events.

These same functions shall be used to trigger any other async
behaviour on start/stop of taskruns.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 27, 2020
Emit events for additional TaskRun lifecyle events:
- taskrun started
- taskrun timeout

Fix broken EmitEvents unit tests and extend them to cover
new functionality.

Introduce pre-run and post-run functions that are invoked
asynchronously when the taskrun starts and completes, to emit
events.

These same functions shall be used to trigger any other async
behaviour on start/stop of taskruns.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 28, 2020
Emit events for additional TaskRun lifecyle events:
- taskrun started
- taskrun running
- taskrun timeout

Fix the logic in events.go to compare semantic equality as
opposed to raw pointer equality.
Fix broken EmitEvents unit tests and extend them to cover new
functionality.

Extend reconcile test to verify new events are sent. To do so,
get the event recorder from the context when creating the
controller - if avaialble. This allows using the fake recorder
for testing instead of having to look for event related actions
in the fake client go action list.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 28, 2020
Emit events for additional TaskRun lifecyle events:
- taskrun started
- taskrun running
- taskrun timeout

Fix the logic in events.go to compare semantic equality as
opposed to raw pointer equality.
Fix broken EmitEvents unit tests and extend them to cover new
functionality.

Extend reconcile test to verify new events are sent. To do so,
get the event recorder from the context when creating the
controller - if avaialble. This allows using the fake recorder
for testing instead of having to look for event related actions
in the fake client go action list.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 28, 2020
Emit events for additional TaskRun lifecyle events:
- taskrun started
- taskrun running
- taskrun timeout

Fix the logic in events.go to compare semantic equality as
opposed to raw pointer equality.
Fix broken EmitEvents unit tests and extend them to cover new
functionality.

Extend reconcile test to verify new events are sent. To do so,
get the event recorder from the context when creating the
controller - if avaialble. This allows using the fake recorder
for testing instead of having to look for event related actions
in the fake client go action list.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue Apr 28, 2020
Emit events for additional TaskRun lifecyle events:
- taskrun started
- taskrun running
- taskrun timeout

Fix the logic in events.go to compare semantic equality as
opposed to raw pointer equality.
Fix broken EmitEvents unit tests and extend them to cover new
functionality.

Extend reconcile test to verify new events are sent. To do so,
get the event recorder from the context when creating the
controller - if avaialble. This allows using the fake recorder
for testing instead of having to look for event related actions
in the fake client go action list.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
@afrittoli
Copy link
Member Author

This was fixed by #2421 and #2365. Proper tests are added in #2329.

afrittoli added a commit to afrittoli/pipeline that referenced this issue May 1, 2020
Emit events for additional TaskRun lifecyle events:
- taskrun started
- taskrun running
- taskrun timeout

Fix the logic in events.go to compare semantic equality as
opposed to raw pointer equality.
Fix broken EmitEvents unit tests and extend them to cover new
functionality.

Extend reconcile test to verify new events are sent. To do so,
get the event recorder from the context when creating the
controller - if avaialble. This allows using the fake recorder
for testing instead of having to look for event related actions
in the fake client go action list.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
afrittoli added a commit to afrittoli/pipeline that referenced this issue May 1, 2020
Emit events for additional TaskRun lifecyle events:
- taskrun started
- taskrun running
- taskrun timeout

Fix the logic in events.go to compare semantic equality as
opposed to raw pointer equality.
Fix broken EmitEvents unit tests and extend them to cover new
functionality.

Extend reconcile test to verify new events are sent. To do so,
get the event recorder from the context when creating the
controller - if avaialble. This allows using the fake recorder
for testing instead of having to look for event related actions
in the fake client go action list.

Add documentation on events.

Fixes tektoncd#2328
Work towards tektoncd#2082
tekton-robot pushed a commit that referenced this issue May 1, 2020
Emit events for additional TaskRun lifecyle events:
- taskrun started
- taskrun running
- taskrun timeout

Fix the logic in events.go to compare semantic equality as
opposed to raw pointer equality.
Fix broken EmitEvents unit tests and extend them to cover new
functionality.

Extend reconcile test to verify new events are sent. To do so,
get the event recorder from the context when creating the
controller - if avaialble. This allows using the fake recorder
for testing instead of having to look for event related actions
in the fake client go action list.

Add documentation on events.

Fixes #2328
Work towards #2082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants