Azure Pipelines "ran longer than the maximum time" (timeout)
The job exceeded its allowed wall-clock time and Azure DevOps canceled it. The cap is timeoutInMinutes if set, otherwise the platform default, which is lower for free hosted parallelism on public-only access.
What this error means
The job fails with ##[error]The job running on agent X ran longer than the maximum time of N minutes and is marked canceled, not failed on a step.
##[error]The job running on agent Hosted Agent ran longer than the maximum
time of 60 minutes. For more information, see https://aka.ms/azpipes-job-timeoutCommon causes
The job genuinely takes longer than the cap
A slow build or test suite exceeds timeoutInMinutes or the default hosted limit, so the platform stops it.
A step hangs waiting on input or a resource
A command that waits for stdin, a lock, or an unreachable service never returns, and the job runs out the clock.
How to fix it
Raise timeoutInMinutes to a realistic value
Set the job timeout above the real runtime (self-hosted and paid hosted allow higher limits).
jobs:
- job: build
timeoutInMinutes: 120
steps:
- script: ./build.shFind and fix the hang
- Check which step was running when the timeout fired.
- Add non-interactive flags so commands never wait for input.
- Add per-step timeouts so a hang fails fast instead of burning the job budget.
How to prevent it
- Set
timeoutInMinutesto match real job duration with headroom. - Use non-interactive flags so steps never block on input.
- Split very long jobs into parallel jobs to stay under limits.