0
0
Jenkinsdevops~10 mins

Build timeouts in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set a build timeout of 10 minutes in a Jenkins pipeline.

Jenkins
timeout(time: [1], unit: 'MINUTES') {
  // build steps
}
Drag options to blanks, or click blank then click option'
A20
B15
C5
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string instead of a number for the time value.
Setting the time too low or too high without reason.
2fill in blank
medium

Complete the code to set a build timeout using the 'timeout' step with a unit of 'SECONDS'.

Jenkins
timeout(time: [1], unit: 'SECONDS') {
  // build steps
}
Drag options to blanks, or click blank then click option'
A60
B120
C30
D300
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing seconds with minutes.
Choosing a time too short for the build.
3fill in blank
hard

Fix the error in the timeout step by completing the missing unit value.

Jenkins
timeout(time: 5, unit: '[1]') {
  // build steps
}
Drag options to blanks, or click blank then click option'
AMINUTES
BHOURS
CSECONDS
DDAYS
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase units like 'minutes' instead of uppercase.
Choosing a unit that does not match the time value.
4fill in blank
hard

Fill both blanks to set a timeout of 2 hours using the Jenkins pipeline syntax.

Jenkins
timeout(time: [1], unit: '[2]') {
  // build steps
}
Drag options to blanks, or click blank then click option'
A2
B120
CHOURS
DMINUTES
Attempts:
3 left
💡 Hint
Common Mistakes
Using 120 with 'HOURS' which would mean 120 hours.
Using 'MINUTES' with 2 which means 2 minutes, not 2 hours.
5fill in blank
hard

Fill all three blanks to create a timeout block that stops the build after 90 minutes.

Jenkins
timeout(time: [1], unit: '[2]') {
  echo '[3]'
}
Drag options to blanks, or click blank then click option'
A90
BMINUTES
CBuild timed out after 90 minutes
DSECONDS
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'SECONDS' instead of 'MINUTES' for the unit.
Setting time to 90 but using 'SECONDS' which means 90 seconds.