Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
202c2c6a
Commit
202c2c6a
authored
Jul 04, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix static analysys
parent
f11aa51e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
spec/lib/gitlab/exclusive_lease_helpers_spec.rb
spec/lib/gitlab/exclusive_lease_helpers_spec.rb
+8
-8
No files found.
spec/lib/gitlab/exclusive_lease_helpers_spec.rb
View file @
202c2c6a
...
...
@@ -9,7 +9,7 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do
describe
'#in_lock'
do
subject
{
class_instance
.
in_lock
(
unique_key
,
**
options
)
{
}
}
let
(
:options
)
{
{
}
}
let
(
:options
)
{
{}
}
context
'when the lease is not obtained yet'
do
before
do
...
...
@@ -43,10 +43,10 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do
end
context
'when ttl is specified'
do
let
(
:options
)
{
{
ttl:
10
.
minute
}
}
let
(
:options
)
{
{
ttl:
10
.
minute
s
}
}
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
.
minute
s
}
)
expect
{
subject
}.
to
raise_error
(
'Failed to obtain a lock'
)
end
...
...
@@ -63,10 +63,10 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do
end
context
'when sleep second is specified'
do
let
(
:options
)
{
{
retries:
0
,
sleep_sec:
0.05
.
second
}
}
let
(
:options
)
{
{
retries:
0
,
sleep_sec:
0.05
.
second
s
}
}
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
.
second
s
).
once
expect
{
subject
}.
to
raise_error
(
'Failed to obtain a lock'
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment