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
Léo-Paul Géneau
gitlab-ce
Commits
91c1dc57
Commit
91c1dc57
authored
Jan 18, 2019
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix runner eternal loop when update job result
Add spec Add changelog
parent
35c3cb7c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
app/models/ci/build.rb
app/models/ci/build.rb
+8
-1
changelogs/unreleased/fix-runner-eternal-loop-when-update-job-result.yml
...leased/fix-runner-eternal-loop-when-update-job-result.yml
+5
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+18
-0
No files found.
app/models/ci/build.rb
View file @
91c1dc57
...
...
@@ -224,8 +224,15 @@ module Ci
before_transition
any
=>
[
:failed
]
do
|
build
|
next
unless
build
.
project
next
unless
build
.
deployment
build
.
deployment
&
.
drop
begin
build
.
deployment
.
drop!
rescue
=>
e
Gitlab
::
Sentry
.
track_exception
(
e
,
extra:
{
build_id:
build
.
id
})
end
true
end
after_transition
any
=>
[
:failed
]
do
|
build
|
...
...
changelogs/unreleased/fix-runner-eternal-loop-when-update-job-result.yml
0 → 100644
View file @
91c1dc57
---
title
:
Fix runner eternal loop when update job result
merge_request
:
24481
author
:
type
:
fixed
spec/models/ci/build_spec.rb
View file @
91c1dc57
...
...
@@ -3028,6 +3028,24 @@ describe Ci::Build do
subject
.
drop!
end
end
context
'when associated deployment failed to update its status'
do
let
(
:build
)
{
create
(
:ci_build
,
:running
,
pipeline:
pipeline
)
}
let!
(
:deployment
)
{
create
(
:deployment
,
deployable:
build
)
}
before
do
allow_any_instance_of
(
Deployment
)
.
to
receive
(
:drop!
).
and_raise
(
'Unexpected error'
)
end
it
'can drop the build'
do
expect
(
Gitlab
::
Sentry
).
to
receive
(
:track_exception
)
expect
{
build
.
drop!
}.
not_to
raise_error
expect
(
build
).
to
be_failed
end
end
end
describe
'.matches_tag_ids'
do
...
...
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