How to Abort the job if its fails in jenkins?

How to stop if the job is running more than 3 hrs due to cannot connect agent pc. its going
on offline mode.
How to add the script in Jenkins if it takes more than 3 hours.

wrap everything in a timeout step

1 Like