Timeout
Last updated on October 28, 2026
You can prevent a phase from running indefinitely by setting a timeout. When it elapses, the phase ends with the TIMEOUT outcome.
A phase without a timeout has no time limit — Python code, plug calls, and operator input all wait as long as they need to.
name: Endurance Test
main:
- name: Run Long Test
python: phases.tests
timeout: 60sDurations combine h (hours), m (minutes), s (seconds), and ms (milliseconds), like 90s, 5m, or 1h30m. A bare number is interpreted as milliseconds. The value must be between 1 millisecond and 24 hours.
The timeout covers everything the phase does: Python code, plug calls, and operator UI prompts all share the same deadline. TofuPilot terminates phases that exceed their timeout and logs a warning in the phase's log at 75% of the timeout duration (75% of its 30s timeout used), regardless of which runtime you use. A plug method the phase was waiting on keeps running in the plug's process (Python cannot cut a call short): the plug takes its next call, a retry's included, only once that one returns. Give a call that can hang on the instrument its own timeout in the driver (a VISA or socket timeout).
The Python worker process is terminated when a phase exceeds its timeout, including while it waits on a plug call.
The executable worker process is terminated when a command exceeds its timeout.
The UI phase is terminated when it exceeds its timeout, even if waiting for operator input. Without a timeout, a prompt waits for the operator indefinitely.
How is this guide?