Skip to content

Commit 55c16ee

Browse files
committed
Fix flaky task timeout override test
- Add missing pipelinerun-with-task-timeout-override.yaml example - Increase timeout from 20s to 45s to account for pod startup overhead - Provides 35s buffer for Kubernetes pod initialization + 10s task execution - Maintains test intent (TaskRunSpecs override Pipeline task timeouts) - Eliminates timing-related flakiness in CI environments Resolves intermittent test failures in examples test matrix where pod startup overhead (17s observed) exceeded the 20s timeout window.
1 parent f5d402b commit 55c16ee

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

examples/v1/pipelineruns/pipelinerun-with-task-timeout-override.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
# This example demonstrates how TaskRunSpecs can override timeout settings
3+
# defined in the Pipeline spec, providing more granular timeout control
14
apiVersion: tekton.dev/v1
25
kind: Task
36
metadata:
@@ -21,8 +24,8 @@ spec:
2124
script: |
2225
#!/bin/sh
2326
echo "- Pipeline task timeout: 60s (defined in pipeline spec)"
24-
echo "- TaskRunSpecs override: 20s (defined in pipelinerun spec)"
25-
echo "- Actual task duration: 10s (within 20s override timeout)"
27+
echo "- TaskRunSpecs override: 45s (defined in pipelinerun spec)"
28+
echo "- Actual task duration: 10s (within 45s override timeout)"
2629
---
2730
apiVersion: tekton.dev/v1
2831
kind: Pipeline
@@ -32,14 +35,15 @@ spec:
3235
tasks:
3336
- name: long-running-task
3437
taskRef:
35-
name: sleep-task
3638
kind: Task
37-
timeout: "60s" # pipeline task timeout (will be overridden to 20s)
39+
name: sleep-task
40+
timeout: 1m0s # 60 seconds - this is the baseline timeout
3841
- name: verify-timeout
42+
runAfter:
43+
- long-running-task
3944
taskRef:
40-
name: verify-task
4145
kind: Task
42-
runAfter: ["long-running-task"]
46+
name: verify-task
4347
---
4448
apiVersion: tekton.dev/v1
4549
kind: PipelineRun
@@ -50,4 +54,5 @@ spec:
5054
name: taskrun-timeout-override
5155
taskRunSpecs:
5256
- pipelineTaskName: long-running-task
53-
timeout: "20s" # 20s timeout (can't actually test with a timeout lesser than 10s else the task fails)
57+
serviceAccountName: default
58+
timeout: 45s # Override: reduced from 60s to 45s to demonstrate override functionality

0 commit comments

Comments
 (0)