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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
cafc543c
Commit
cafc543c
authored
Dec 18, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust flaky Rails logger call test
parent
aa2c729e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
app/workers/stuck_merge_jobs_worker.rb
app/workers/stuck_merge_jobs_worker.rb
+5
-1
spec/workers/stuck_merge_jobs_worker_spec.rb
spec/workers/stuck_merge_jobs_worker_spec.rb
+2
-1
No files found.
app/workers/stuck_merge_jobs_worker.rb
View file @
cafc543c
...
...
@@ -4,6 +4,10 @@ class StuckMergeJobsWorker
include
ApplicationWorker
include
CronjobQueue
def
self
.
logger
Rails
.
logger
end
# rubocop: disable CodeReuse/ActiveRecord
def
perform
stuck_merge_requests
.
find_in_batches
(
batch_size:
100
)
do
|
group
|
...
...
@@ -35,7 +39,7 @@ class StuckMergeJobsWorker
# We rely on state machine callbacks to update head_pipeline_id
merge_requests_to_reopen
.
each
(
&
:unlock_mr
)
Rail
s
.
logger
.
info
(
"Updated state of locked merge jobs. JIDs:
#{
completed_jids
.
join
(
', '
)
}
"
)
self
.
clas
s
.
logger
.
info
(
"Updated state of locked merge jobs. JIDs:
#{
completed_jids
.
join
(
', '
)
}
"
)
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
spec/workers/stuck_merge_jobs_worker_spec.rb
View file @
cafc543c
...
...
@@ -38,7 +38,8 @@ describe StuckMergeJobsWorker do
create
(
:merge_request
,
:locked
,
merge_jid:
'123'
)
create
(
:merge_request
,
:locked
,
merge_jid:
'456'
)
expect
(
Rails
).
to
receive_message_chain
(
:logger
,
:info
).
with
(
'Updated state of locked merge jobs. JIDs: 123, 456'
)
expect
(
described_class
).
to
receive_message_chain
(
:logger
,
:info
)
.
with
(
'Updated state of locked merge jobs. JIDs: 123, 456'
)
worker
.
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