Set default runner script timeout to allow after_script
What does this MR do / why needed?
Sets the default runner script timeout to be -5 minutes (the default timeout for after_script
) from the time remaining for the job.
This is intended to allow time for after_script and other stages to execute towards the end of the job. This won't always work, and sometimes setting the runner and after_script timeouts explicitly will be required for every stage to complete in time, but this is seen as a sane default that will work in the majority of cases.
This default is set regardless of whether an after_script
has been defined, because it's also used by any other stages that might run (artifacts, caches, cleanup etc.).
What's the best way to test this MR?
- Run a job and set the timeout to 10m.
- Run a long-running script.
- Long running script should terminate, and
after_script
still have time to run.