Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-17 06:08:18 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-17 06:08:18 +0300
commit40fb10f78e8f42631cc00ea87126782a3a79c5e6 (patch)
treef58dd4c35403a04fb0e20b467dffaa7ef03ab225 /spec/services
parentf5aa3fa295173433148adfe9240d82874d90136f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/projects/container_repository/third_party/cleanup_tags_service_spec.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/services/projects/container_repository/third_party/cleanup_tags_service_spec.rb b/spec/services/projects/container_repository/third_party/cleanup_tags_service_spec.rb
index 836e722eb99..78343490e3a 100644
--- a/spec/services/projects/container_repository/third_party/cleanup_tags_service_spec.rb
+++ b/spec/services/projects/container_repository/third_party/cleanup_tags_service_spec.rb
@@ -325,9 +325,13 @@ RSpec.describe Projects::ContainerRepository::ThirdParty::CleanupTagsService, :c
Gitlab::Redis::Cache.with do |redis|
expect(redis).to receive(:pipelined).and_call_original
- expect_next_instance_of(Redis::PipelinedConnection) do |pipeline|
+ times = Gitlab::Redis::ClusterUtil.cluster?(redis) ? 2 : 1
+
+ # Set 2 instances as redis is a MultiStore.
+ # Redis Cluster uses only 1 pipeline as the keys have hash-tags
+ expect_next_instances_of(Redis::PipelinedConnection, times) do |pipeline|
selected_tags.each do |tag_name, created_at, ex|
- expect(pipeline).to receive(:set).with(cache_key(tag_name), rfc3339(created_at), ex: ex)
+ expect(pipeline).to receive(:set).with(cache_key(tag_name), rfc3339(created_at), ex: ex).and_call_original
end
end
end
@@ -372,7 +376,11 @@ RSpec.describe Projects::ContainerRepository::ThirdParty::CleanupTagsService, :c
expect(redis).to receive(:mget).and_call_original
expect(redis).to receive(:pipelined).and_call_original
- expect_next_instance_of(Redis::PipelinedConnection) do |pipeline|
+ times = Gitlab::Redis::ClusterUtil.cluster?(redis) ? 2 : 1
+
+ # Set 2 instances as redis is a MultiStore
+ # Redis Cluster uses only 1 pipeline as the keys have hash-tags
+ expect_next_instances_of(Redis::PipelinedConnection, times) do |pipeline|
expect(pipeline).to receive(:set).and_call_original
end
end