summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-04-02 10:50:58 +0100
committerSean McGivern <sean@gitlab.com>2019-04-02 10:50:58 +0100
commite540ae798b812bf4b6068fbb0e7f22ade7d5f309 (patch)
tree0bcef43f6392b913c728f46b7fe17d214d8d3912
parentf87b7fe3b386962c45e83486634352da544857fb (diff)
downloadgitlab-ce-ce-6119-extract-ee-specific-files-lines-for-spec-services-groups.tar.gz
This was removed in the below MR in EE only, as it was causing failures related to Geo. https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3999
-rw-r--r--spec/services/groups/destroy_service_spec.rb38
1 files changed, 0 insertions, 38 deletions
diff --git a/spec/services/groups/destroy_service_spec.rb b/spec/services/groups/destroy_service_spec.rb
index d80d0f5a8a8..98114ea4919 100644
--- a/spec/services/groups/destroy_service_spec.rb
+++ b/spec/services/groups/destroy_service_spec.rb
@@ -82,44 +82,6 @@ describe Groups::DestroyService do
expect(Group.unscoped.count).to eq(2)
end
end
-
- context 'potential race conditions' do
- context "when the `GroupDestroyWorker` task runs immediately" do
- it "deletes the group" do
- # Commit the contents of this spec's transaction so far
- # so subsequent db connections can see it.
- #
- # DO NOT REMOVE THIS LINE, even if you see a WARNING with "No
- # transaction is currently in progress". Without this, this
- # spec will always be green, since the group created in setup
- # cannot be seen by any other connections / threads in this spec.
- Group.connection.commit_db_transaction
-
- group_record = run_with_new_database_connection do |conn|
- conn.execute("SELECT * FROM namespaces WHERE id = #{group.id}").first
- end
-
- expect(group_record).not_to be_nil
-
- # Execute the contents of `GroupDestroyWorker` in a separate thread, to
- # simulate data manipulation by the Sidekiq worker (different database
- # connection / transaction).
- expect(GroupDestroyWorker).to receive(:perform_async).and_wrap_original do |m, group_id, user_id|
- Thread.new { m[group_id, user_id] }.join(5)
- end
-
- # Kick off the initial group destroy in a new thread, so that
- # it doesn't share this spec's database transaction.
- Thread.new { described_class.new(group, user).async_execute }.join(5)
-
- group_record = run_with_new_database_connection do |conn|
- conn.execute("SELECT * FROM namespaces WHERE id = #{group.id}").first
- end
-
- expect(group_record).to be_nil
- end
- end
- end
end
describe 'synchronous delete' do