Skip to content

[Flaky Test] Fix pipeline schedules controller spec

What does this MR do and why?

Fixes flaky test where test run times makes it difficult to replicate throttled requests. The purpose of this spec is to ensure that when a request to this endpoint is throttled, the expected block yields - by making the request 2 times in a row sometimes there is a delay long enough between requests to cause the spec to fail. The initial fix to freeze time, may not extend to the rate limit check. Since the limit checking classes have their own specs to ensure they are working correctly, it is reasonable to stub Gitlab::ApplicationRateLimiter#throtted_request?

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

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

Related to #497949 (closed)

Merge request reports

Loading