Commit 202c2c6a authored by Shinya Maeda's avatar Shinya Maeda

Fix static analysys

parent f11aa51e
...@@ -9,7 +9,7 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do ...@@ -9,7 +9,7 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do
describe '#in_lock' do describe '#in_lock' do
subject { class_instance.in_lock(unique_key, **options) { } } subject { class_instance.in_lock(unique_key, **options) { } }
let(:options) { { } } let(:options) { {} }
context 'when the lease is not obtained yet' do context 'when the lease is not obtained yet' do
before do before do
...@@ -43,10 +43,10 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do ...@@ -43,10 +43,10 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do
end end
context 'when ttl is specified' do context 'when ttl is specified' do
let(:options) { { ttl: 10.minute } } let(:options) { { ttl: 10.minutes } }
it 'receives the specified argument' do it 'receives the specified argument' do
expect(Gitlab::ExclusiveLease).to receive(:new).with(unique_key, { timeout: 10.minute } ) expect(Gitlab::ExclusiveLease).to receive(:new).with(unique_key, { timeout: 10.minutes } )
expect { subject }.to raise_error('Failed to obtain a lock') expect { subject }.to raise_error('Failed to obtain a lock')
end end
...@@ -63,10 +63,10 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do ...@@ -63,10 +63,10 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do
end end
context 'when sleep second is specified' do context 'when sleep second is specified' do
let(:options) { { retries: 0, sleep_sec: 0.05.second } } let(:options) { { retries: 0, sleep_sec: 0.05.seconds } }
it 'receives the specified argument' do it 'receives the specified argument' do
expect(class_instance).to receive(:sleep).with(0.05.second).once expect(class_instance).to receive(:sleep).with(0.05.seconds).once
expect { subject }.to raise_error('Failed to obtain a lock') expect { subject }.to raise_error('Failed to obtain a lock')
end end
......
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