0
0
Jenkinsdevops~5 mins

Build timeouts in Jenkins - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a build timeout in Jenkins?
A build timeout in Jenkins is a setting that stops a build if it runs longer than a specified time. This helps save resources and avoid stuck builds.
Click to reveal answer
beginner
How do you set a build timeout in a Jenkins Pipeline script?
You use the timeout step with a time limit and unit, for example:
timeout(time: 10, unit: 'MINUTES') { /* build steps */ }
Click to reveal answer
beginner
Why is it important to use build timeouts?
Build timeouts prevent builds from running forever, which can block other jobs and waste server resources. They help keep the CI/CD system healthy and responsive.
Click to reveal answer
beginner
What happens when a Jenkins build times out?
When a build times out, Jenkins stops the build and marks it as failed or aborted. This lets you know the build did not finish in time.
Click to reveal answer
intermediate
Can you customize the timeout behavior in Jenkins?
Yes, Jenkins allows you to customize timeout behavior, such as setting different time limits, choosing to fail or abort the build, and adding messages or cleanup steps.
Click to reveal answer
What is the main purpose of setting a build timeout in Jenkins?
ATo increase the build timeout automatically
BTo speed up the build process
CTo restart builds after failure
DTo stop builds that run too long and save resources
Which Jenkins Pipeline step is used to set a build timeout?
Await
Btimeout
Csleep
Ddelay
What happens if a Jenkins build exceeds the timeout limit?
AThe build is stopped and marked failed or aborted
BThe build continues running
CThe build restarts automatically
DThe timeout is ignored
How do you specify the time unit in a Jenkins timeout step?
AUsing the 'duration' parameter like 'HOURS'
BUsing the 'timeUnit' parameter like 'SECONDS'
CUsing the 'unit' parameter like 'MINUTES'
DUsing the 'interval' parameter like 'DAYS'
Can build timeouts be set differently for each Jenkins job?
AYes, each job can have its own timeout settings
BNo, timeout is global for all jobs
CTimeouts are only set at the Jenkins system level
DTimeouts cannot be customized
Explain what a build timeout is in Jenkins and why it is useful.
Think about what happens if a build never stops.
You got /4 concepts.
    Describe how to set a build timeout in a Jenkins Pipeline script with an example.
    Look for a block that limits build time.
    You got /3 concepts.