Interview Prep/Jenkins/Declarative pipeline syntax

What do `retry`, `timeout` and `waitUntil` do as steps?

AdvancedConceptDeclarative pipeline syntax
Answer
retry(count: 3, conditions: [agent(), kubernetesAgent(), nonresumable()]) {
  sh 'mvn -B deploy'
}
timeout(time: 10, unit: 'MINUTES') { sh './e2e.sh' }
timeout(time: 5, unit: 'MINUTES') {
  waitUntil(initialRecurrencePeriod: 5000) {
    sh(script: 'curl -fs https://app/healthz', returnStatus: true) == 0
  }
}

retry with conditions retries only on infrastructure failures (agent lost, pod deleted), not on real test failures, which is what you want in production.

All Jenkins questions Roadmap: Jenkins

More on Declarative pipeline syntax