Introduction
Sometimes your Jenkins pipeline steps take too long or fail temporarily. The options directive helps you control how long a step can run and how many times it should retry if it fails.
When a build step might hang or take longer than expected and you want to stop it automatically.
When a flaky test sometimes fails and you want Jenkins to try it again before marking the build as failed.
When you want to limit the total time a pipeline can run to save resources.
When you want to automatically retry a deployment step that might fail due to temporary network issues.
When you want to avoid manual intervention by setting automatic retries and timeouts.