Fix ProjectPipelineStatus cache specs flakiness
What does this MR do?
While working on #227383 (closed) I noticed that 2 spec examples are extremely inconsistent if you run them more than once. Also, I noticed that running gdk restart
allows them to pass one time.
bin/rspec spec/services/ci/expire_pipeline_cache_service_spec.rb:52 spec/services/ci/destroy_pipeline_service_spec.rb:20
It happens because we use redis caching and never clean the caching key since we use the tag use_clean_rails_memory_store_caching
instead of use_clean_rails_redis_caching
. This MR fixes the issue and these specs start to pass every time.
Relevant code:
- https://gitlab.com/gitlab-org/gitlab/blob/fix-pipeline-cache-flakiness/lib/gitlab/cache/ci/project_pipeline_status.rb#L107-113
- https://gitlab.com/gitlab-org/gitlab/blob/fix-pipeline-cache-flakiness/lib/gitlab/cache/ci/project_pipeline_status.rb#L87-93
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?- [-] I have included a changelog entry.
-
I have not included a changelog entry because this is not a user-facing change.
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Dmitry Gruzd