Skip to content

Fix InactiveProjectsDeletionCronWorker not timing out after maximum allowed run time

Huzaifa Iftikhar requested to merge 363319_fix_cron_not_timing_out into master

What does this MR do and why?

  • In this MR !88751 (merged) we added a maximum allowed run time for theInactiveProjectsDeletionCronWorker,however, we missed timing out in case the feature flag was disabled.
  • This MR fixes this behavior and moves the over_time? check above the feature flag check to ensure that the the worker is timed out after exceeding the maximum allowed run time.
  • Make the existing RSpecs related to the timeout as shared_examples and added these examples to both the scenarios when the feature flag is enabled and when it's disabled to ensure that the worker is timed out even if the feature flag is disabled.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/363319

Edited by Huzaifa Iftikhar

Merge request reports