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
91f19e54
Commit
91f19e54
authored
Sep 10, 2021
by
Maxime Orefice
Committed by
Grzegorz Bizon
Sep 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop ci_pending_build when calling `Ci::Build#doom!`
parent
d3d80a33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
app/models/ci/build.rb
app/models/ci/build.rb
+4
-3
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+19
-0
No files found.
app/models/ci/build.rb
View file @
91f19e54
...
...
@@ -1031,9 +1031,10 @@ module Ci
# Consider this object to have a structural integrity problems
def
doom!
update_columns
(
status: :failed
,
failure_reason: :data_integrity_failure
)
transaction
do
update_columns
(
status: :failed
,
failure_reason: :data_integrity_failure
)
all_queuing_entries
.
delete_all
end
end
def
degradation_threshold
...
...
spec/models/ci/build_spec.rb
View file @
91f19e54
...
...
@@ -5269,4 +5269,23 @@ RSpec.describe Ci::Build do
build
.
ensure_trace_metadata!
end
end
describe
'#doom!'
do
subject
{
build
.
doom!
}
let_it_be
(
:build
)
{
create
(
:ci_build
,
:queued
)
}
it
'updates status and failure_reason'
,
:aggregate_failures
do
subject
expect
(
build
.
status
).
to
eq
(
"failed"
)
expect
(
build
.
failure_reason
).
to
eq
(
"data_integrity_failure"
)
end
it
'drops associated pending build'
do
subject
expect
(
build
.
reload
.
queuing_entry
).
not_to
be_present
end
end
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