0
0
Jenkinsdevops~10 mins

Options directive (timeout, retry) 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 timeout of 10 minutes for the Jenkins pipeline stage.

Jenkins
options {
  timeout(time: [1], unit: 'MINUTES')
}
Drag options to blanks, or click blank then click option'
A10
B5
C15
D20
Attempts:
3 left
💡 Hint
Common Mistakes
Using seconds instead of minutes
Forgetting to specify the unit
2fill in blank
medium

Complete the code to retry the pipeline 3 times on failure.

Jenkins
options {
  retry(count: [1])
}
Drag options to blanks, or click blank then click option'
A3
B1
C5
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting retry to 0 which disables retries
Using too high retry count causing long waits
3fill in blank
hard

Fix the error in the options directive to set a timeout of 15 minutes.

Jenkins
options {
  timeout(time: [1], unit: 'minutes')
}
Drag options to blanks, or click blank then click option'
A15m
B15
C'15'
Dfifteen
Attempts:
3 left
💡 Hint
Common Mistakes
Using string instead of number
Using words or suffixes like 'm'
4fill in blank
hard

Fill both blanks to set a retry count of 4 and a timeout of 20 minutes.

Jenkins
options {
  retry(count: [1])
  timeout(time: [2], unit: 'MINUTES')
}
Drag options to blanks, or click blank then click option'
A4
B20
C10
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing retry and timeout values
Using wrong units or types
5fill in blank
hard

Fill all three blanks to set a retry count of 2, a timeout of 5 minutes, and use the correct unit.

Jenkins
options {
  retry(count: [1])
  timeout(time: [2], unit: '[3]')
}
Drag options to blanks, or click blank then click option'
A2
B5
CMINUTES
DSECONDS
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase unit
Using wrong retry count or timeout values