Timeout
Set a maximum run time for a stage or step. Harness terminates it if it exceeds the timeout duration.
Timeout duration sets the maximum time a stage or step is allowed to run. If it is still running when the timeout expires, Harness terminates it and marks it as Expired. The default for stages is 24h.
What you will learn
How to set a maximum run time for a stage or step using the
timeoutkeyWhat duration formats are accepted
How a timed-out stage is marked and how to handle timeouts using on-failure rules
YAML
Use the timeout key on the stage:
stages:
- name: build
id: build
timeout: 30m
steps:
- name: compile
id: compile
run:
script: make buildDuration format
Seconds
90s
1 minute 30 seconds
Minutes
30m
30 minutes
Hours
2h
2 hours
Days
1d
24 hours
Combined
1h 30m
1 hour 30 minutes
Behavior
When a stage times out, it is marked as Expired and the pipeline is stopped.
You can configure On failure with
errors: [timeout]to handle timeouts specifically, for example to retry the stage.Individual steps can also have their own timeouts. If a step times out before the stage timeout is reached, the step expires first.
Next steps
Go to On failure to configure retry or abort behavior when a timeout occurs.
Go to Pipelines overview to review the pipeline model.
Last updated
Was this helpful?