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
6c1a4294
Commit
6c1a4294
authored
Nov 27, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stuck jobs tests
parent
07c7ba1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
spec/workers/stuck_ci_jobs_worker_spec.rb
spec/workers/stuck_ci_jobs_worker_spec.rb
+4
-4
No files found.
spec/workers/stuck_ci_jobs_worker_spec.rb
View file @
6c1a4294
...
...
@@ -106,7 +106,7 @@ describe StuckCiJobsWorker do
end
it
'does drop job'
do
expect_any_instance_of
(
Ci
::
Build
).
to
receive
(
:drop
)
expect_any_instance_of
(
Ci
::
Build
).
to
receive
(
:drop
)
.
and_call_original
worker
.
perform
end
end
...
...
@@ -117,7 +117,7 @@ describe StuckCiJobsWorker do
let
(
:worker2
)
{
described_class
.
new
}
it
'is guard by exclusive lease when executed concurrently'
do
expect
(
worker
).
to
receive
(
:drop
).
at_least
(
:once
)
expect
(
worker
).
to
receive
(
:drop
).
at_least
(
:once
)
.
and_call_original
expect
(
worker2
).
not_to
receive
(
:drop
)
worker
.
perform
allow_any_instance_of
(
Gitlab
::
ExclusiveLease
).
to
receive
(
:try_obtain
).
and_return
(
false
)
...
...
@@ -125,8 +125,8 @@ describe StuckCiJobsWorker do
end
it
'can be executed in sequence'
do
expect
(
worker
).
to
receive
(
:drop
).
at_least
(
:once
)
expect
(
worker2
).
to
receive
(
:drop
).
at_least
(
:once
)
expect
(
worker
).
to
receive
(
:drop
).
at_least
(
:once
)
.
and_call_original
expect
(
worker2
).
to
receive
(
:drop
).
at_least
(
:once
)
.
and_call_original
worker
.
perform
worker2
.
perform
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