Recall & Review
beginner
What does the
timeout option do in a Jenkins pipeline?The
timeout option stops the pipeline if it runs longer than the specified time. This helps avoid stuck or slow builds.Click to reveal answer
beginner
How does the
retry option help in Jenkins pipelines?The
retry option tries to run a block of steps again if they fail, up to a set number of times. It helps handle temporary errors.Click to reveal answer
intermediate
Show a simple Jenkins pipeline snippet using
timeout and retry options.pipeline {
options {
timeout(time: 10, unit: 'MINUTES')
}
stages {
stage('Build') {
steps {
retry(3) {
echo 'Building...'
}
}
}
}
}
Click to reveal answer
beginner
What happens if a Jenkins pipeline step exceeds the
timeout duration?Jenkins stops the pipeline and marks it as failed. This prevents wasting resources on stuck or very slow builds.
Click to reveal answer
intermediate
Can the
retry option be used inside a specific stage or only globally in Jenkins pipelines?The
retry option can be used inside specific stages or steps to retry only that part, or globally to retry the whole pipeline block.Click to reveal answer
What does the Jenkins
timeout option control?✗ Incorrect
The
timeout option sets the maximum allowed time for a pipeline or stage to run before Jenkins stops it.How many times will Jenkins retry a step if
retry(3) is set and the step keeps failing?✗ Incorrect
The
retry(3) option means Jenkins will try the step up to 3 times if it fails.Where can the
timeout option be placed in a Jenkins pipeline?✗ Incorrect
The
timeout option is used inside the options block, which can be at the pipeline or stage level.What happens if a step fails but no
retry option is set?✗ Incorrect
Without
retry, a failed step causes the pipeline to fail immediately.Which unit can be used with the Jenkins
timeout option?✗ Incorrect
Jenkins
timeout supports units like SECONDS, MINUTES, and HOURS.Explain how the
timeout and retry options improve Jenkins pipeline reliability.Think about how these options prevent failures and delays.
You got /4 concepts.
Describe where and how to use the
timeout and retry options in a Jenkins pipeline script.Consider the syntax and placement in the Jenkinsfile.
You got /4 concepts.