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

Unexpected start times reported for skipped steps #2416

Closed
AlanGreene opened this issue Apr 16, 2020 · 4 comments
Closed

Unexpected start times reported for skipped steps #2416

AlanGreene opened this issue Apr 16, 2020 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@AlanGreene
Copy link
Member

Expected Behavior

Step start times should be sequential regardless of whether they actually ran or not.

Actual Behavior

If a TaskRun fails, any remaining skipped steps retain their original container start time instead of being updated by the entrypoint binary.

Steps to Reproduce the Problem

kubectl create -f - << EOF
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  generateName: test-start-time-correct-
spec:
  taskSpec:
    steps:
    - image: ubuntu
      script: |
        #!/usr/bin/env bash
        sleep 3 && echo step 1
    - image: ubuntu
      script: |
        #!/usr/bin/env bash
        sleep 3 && echo step 2
    - image: ubuntu
      script: |
        #!/usr/bin/env bash
        sleep 3 && echo step 3
    - image: ubuntu
      script: |
        #!/usr/bin/env bash
        sleep 3 && echo step 4
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  generateName: test-start-time-wrong-
spec:
  taskSpec:
    steps:
    - image: ubuntu
      script: |
        #!/usr/bin/env bash
        sleep 3 && echo step 1
    - image: ubuntu
      script: |
        #!/usr/bin/env bash
        sleep 3 && echo step 2
        false
    - image: ubuntu
      script: |
        #!/usr/bin/env bash
        sleep 3 && echo step 3
    - image: ubuntu
      script: |
        #!/usr/bin/env bash
        sleep 3 && echo step 4
EOF

The step start times for test-start-time-correct- are recorded and reported correctly, reflecting the time the step actually executed.

The step start times for the first 2 steps in test-start-time-wrong- are correct, but the last 2 skipped steps still report their original container start times. This means that if I order the step status by start time they appear before the steps that actually ran.

Additional Info

  • Kubernetes version:

    Output of kubectl version:

    Client Version: v1.16.3
    Server Version: v1.15.5
    
  • Tekton Pipeline version:

    Output of tkn version or kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

    v0.11.1

/kind bug

Related issue: #1512
This fixed the start times for steps that are actually executed.

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 16, 2020
vincent-pli added a commit to vincent-pli/pipeline that referenced this issue Apr 19, 2020
Fix issue: tektoncd#2416

The root cause is in skipped case, entrypoint do not write startedAt to Termination file.
That's means when reconcile of taskrun try to update startedAt, they found nothing, and the result is the startedAt will keep as the startedAt in pod.
tekton-robot pushed a commit that referenced this issue Apr 20, 2020
Fix issue: #2416

The root cause is in skipped case, entrypoint do not write startedAt to Termination file.
That's means when reconcile of taskrun try to update startedAt, they found nothing, and the result is the startedAt will keep as the startedAt in pod.
@vincent-pli
Copy link
Member

Fixed by #2429

@vdemeester
Copy link
Member

/close

@tekton-robot
Copy link
Collaborator

@vdemeester: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@AlanGreene
Copy link
Member Author

Thanks @vincent-pli, verified on the latest nightly build.

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

No branches or pull requests

4 participants