Environment `auto_stop_in` doesn't engage when the last deployment had failed
Background
Summary
There is a job deploying to an environment with auto_stop_in
defined.
- First run succeeds, environment is running.
- Then there is a new pipline (e.g. after a code change) deploying to the same environment and it fails.
After the deployment fails, the stop job does not run after the defined period.
Please check this discussion for further insights.
Steps to Reproduce
- Create a pipeline that deploys an environment.
- Make it deploy successfully with a stop job assigned and
auto_stop_in
defined in some minutes. - Update the deploy job so it fails, and push a new commit.
- Wait for the stop job to run - it will not.
Please note the following from documentation:
Due to resource limitations, a background worker for stopping environments only runs once every hour. This means that environments aren’t stopped at the exact timestamp specified, but are instead stopped when the hourly cron worker detects expired environments.
Example Project
https://gitlab.com/danielkucera/auto_stop_in_test/-/jobs (see .gitlab-ci.yml
for example)
What is the current bug behavior?
Stop job doesn't run.
What is the expected correct behavior?
Stop job runs in the next scheduled run (after the defined time had elapsed).
Proposal
After Allow users to cleanup partial resources from f... (#435128 - closed) is implemented, enable the change for the affected project in this issue.