summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-09-13 22:02:04 -0700
committerStan Hu <stanhu@gmail.com>2018-09-19 05:03:18 -0700
commita1912ccc894386b112faba2932f1dd98c03aea0e (patch)
tree82eee97163f1802be69cd5810fe04bec96ae2689 /spec/services
parentc6660e61b267dafe7e4f6ce2b4e38b644e7b2177 (diff)
downloadgitlab-ce-a1912ccc894386b112faba2932f1dd98c03aea0e.tar.gz
Delete container repository tags outside of transaction
When there are many tags in a container repository, deleting them can exceed the default 60 second idle-in-transaction timeout in Sidekiq. We now explicitly delete them in the DestroyService before destroying the model. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51380
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/projects/container_repository/destroy_service_spec.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/services/projects/container_repository/destroy_service_spec.rb b/spec/services/projects/container_repository/destroy_service_spec.rb
index 307ccc88865..af54e1b15e3 100644
--- a/spec/services/projects/container_repository/destroy_service_spec.rb
+++ b/spec/services/projects/container_repository/destroy_service_spec.rb
@@ -33,6 +33,7 @@ describe Projects::ContainerRepository::DestroyService do
end
it 'deletes the repository' do
+ expect(repository).to receive(:delete_tags!).twice.and_call_original
expect { described_class.new(project, user).execute(repository) }.to change { ContainerRepository.all.count }.by(-1)
end
end