You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature allows a Task author to specify a Step timeout in a
Taskrun.
An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.
Closes#1690
If the `Step` execution time exceeds the specified timeout, the `Step` kills
249
+
its running process and any subsequent `Steps` in the `TaskRun` will not be
250
+
executed. The `TaskRun` is placed into a `Failed` condition. An accompanying log
251
+
describing which `Step` timed out is written as the `Failed` condition's message.
252
+
253
+
The timeout specification follows the duration format as specified in the [Go time package](https://golang.org/pkg/time/#ParseDuration) (e.g. 1s or 1ms).
254
+
255
+
The example `Step` below is supposed to sleep for 60 seconds but will be canceled by the specified 5 second timeout.
256
+
```yaml
257
+
steps:
258
+
- name: sleep-then-timeout
259
+
image: ubuntu
260
+
script: |
261
+
#!/usr/bin/env bash
262
+
echo "I am supposed to sleep for 60 seconds!"
263
+
sleep 60
264
+
timeout: 5s
265
+
```
245
266
### Specifying `Parameters`
246
267
247
268
You can specify parameters, such as compilation flags or artifact names, that you want to supply to the `Task` at execution time.
0 commit comments