Commit fa449937 authored by Alex Kalderimis's avatar Alex Kalderimis

Add failing diagnostic spec

parent db7ab32c
......@@ -12,6 +12,11 @@ describe Mutations::DesignManagement::Upload do
described_class.new(object: nil, context: { current_user: user }, field: nil)
end
def run_mutation(fs = files)
mutation = described_class.new(object: nil, context: { current_user: user }, field: nil)
mutation.resolve(project_path: project.full_path, iid: issue.iid, files: fs)
end
describe "#resolve" do
let(:files) { [fixture_file_upload('spec/fixtures/dk.png')] }
......@@ -34,6 +39,37 @@ describe Mutations::DesignManagement::Upload do
enable_design_management
end
describe 'contention in the design repo' do
let(:files) do
[
fixture_file_upload('spec/fixtures/dk.png'),
fixture_file_upload('spec/fixtures/rails_sample.jpg'),
fixture_file_upload('spec/fixtures/banana_sample.gif')
].cycle(20).to_a
end
describe 'running requests in parallel' do
it 'does not cause errors' do
expect do
threads = files.map do |f|
Thread.new { run_mutation([f]) }
end
threads.each(&:join)
end.not_to raise_error
end
end
describe 'running requests in serial' do
it 'does not cause errors' do
expect do
files.each do |f|
run_mutation([f])
end
end.not_to raise_error
end
end
end
context "when the user is not allowed to upload designs" do
let(:user) { create(:user) }
......
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