feat: command timeouts (#2898)

This commit is contained in:
Valentin Maerten
2026-08-11 22:09:25 +02:00
committed by GitHub
parent 993508c782
commit 37898d9102
21 changed files with 830 additions and 50 deletions

57
testdata/timeout/Taskfile.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
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
slow-if-condition:
desc: Condition that hangs must be bounded by the command timeout
cmds:
- cmd: echo "condition was met"
if: sleep 10
timeout: 500ms
inherited-timeout:
desc: Calls a task whose command declares no timeout of its own
cmds:
- task: slow-without-timeout
timeout: 500ms
slow-without-timeout:
cmds:
- sleep 10
larger-child-timeout:
desc: Calls a task whose command declares a timeout it never reaches
cmds:
- task: slow-with-larger-timeout
timeout: 500ms
slow-with-larger-timeout:
cmds:
- cmd: sleep 10
timeout: 10m