Commit 7a96fb91 authored by Robert May's avatar Robert May

Mark n+1 tests as flaky

parent 6592e5fc
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require "spec_helper" require "spec_helper"
RSpec.describe API::MergeRequests, :with_clean_rails_cache do RSpec.describe API::MergeRequests do
include ProjectForksHelper include ProjectForksHelper
let_it_be(:base_time) { Time.now } let_it_be(:base_time) { Time.now }
...@@ -52,7 +52,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do ...@@ -52,7 +52,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
end end
context 'when authenticated' do context 'when authenticated' do
it 'avoids N+1 queries', :use_sql_query_cache do it 'avoids N+1 queries', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/330335' do
control = ActiveRecord::QueryRecorder.new do control = ActiveRecord::QueryRecorder.new do
get api(endpoint_path, user) get api(endpoint_path, user)
end end
...@@ -142,7 +142,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do ...@@ -142,7 +142,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
expect(json_response.last['labels'].first).to match_schema('/public_api/v4/label_basic') expect(json_response.last['labels'].first).to match_schema('/public_api/v4/label_basic')
end end
it 'avoids N+1 queries' do it 'avoids N+1 queries', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/330335' do
path = endpoint_path + "?with_labels_details=true" path = endpoint_path + "?with_labels_details=true"
control = ActiveRecord::QueryRecorder.new do control = ActiveRecord::QueryRecorder.new do
...@@ -973,6 +973,14 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do ...@@ -973,6 +973,14 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
it_behaves_like 'merge requests list' it_behaves_like 'merge requests list'
context 'when :api_caching_merge_requests is disabled' do
before do
stub_feature_flags(api_caching_merge_requests: false)
end
it_behaves_like 'merge requests list'
end
it "returns 404 for non public projects" do it "returns 404 for non public projects" do
project = create(:project, :private) project = create(:project, :private)
...@@ -1049,7 +1057,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do ...@@ -1049,7 +1057,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
include_context 'with merge requests' include_context 'with merge requests'
it 'avoids N+1 queries' do it 'avoids N+1 queries', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/330335' do
control = ActiveRecord::QueryRecorder.new do control = ActiveRecord::QueryRecorder.new do
get api("/projects/#{project.id}/merge_requests", user) get api("/projects/#{project.id}/merge_requests", user)
end.count end.count
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment