Files
go-task/testdata/timeout/Taskfile.yml
Valentin Maerten 4d5f7337c1 feat: add command-level timeout support
Add a per-command `timeout` option that terminates a command once it
exceeds the given duration, preventing commands from hanging indefinitely
in a pipeline. Uses Go duration syntax (e.g. 30s, 5m, 1h30m) and applies
to both shell commands and task calls.

Closes #1569
2026-06-30 10:29:20 +02:00

30 lines
591 B
YAML

version: '3'
tasks:
timeout-exceeded:
desc: Command that should timeout
cmds:
- cmd: sleep 10
timeout: 1s
timeout-not-exceeded:
desc: Command that completes within timeout
cmds:
- cmd: echo "quick command"
timeout: 5s
no-timeout:
desc: Command with no timeout specified
cmds:
- echo "no timeout"
multiple-cmds-timeout:
desc: Multiple commands where one exceeds its timeout
cmds:
- cmd: echo "first"
timeout: 1s
- cmd: sleep 10
timeout: 1s
- cmd: echo "third"
timeout: 1s