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
90f5b42d
Commit
90f5b42d
authored
Nov 11, 2021
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test to sync_partitions_ignore_db_error
parent
0ed79110
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
spec/lib/gitlab/database/partitioning_spec.rb
spec/lib/gitlab/database/partitioning_spec.rb
+33
-0
No files found.
spec/lib/gitlab/database/partitioning_spec.rb
View file @
90f5b42d
...
...
@@ -30,6 +30,39 @@ RSpec.describe Gitlab::Database::Partitioning do
end
end
describe
'.sync_partitions_ignore_db_error'
do
it
'calls sync_partitions'
do
expect
(
described_class
).
to
receive
(
:sync_partitions
)
described_class
.
sync_partitions_ignore_db_error
end
[
ActiveRecord
::
ActiveRecordError
,
PG
::
Error
].
each
do
|
error
|
context
"when
#{
error
}
is raised"
do
before
do
expect
(
described_class
).
to
receive
(
:sync_partitions
)
.
and_raise
(
error
)
end
it
'ignores it'
do
described_class
.
sync_partitions_ignore_db_error
end
end
end
context
'when DISABLE_POSTGRES_PARTITION_CREATION_ON_STARTUP is set'
do
before
do
stub_env
(
'DISABLE_POSTGRES_PARTITION_CREATION_ON_STARTUP'
,
'1'
)
end
it
'does not call sync_partitions'
do
expect
(
described_class
).
to
receive
(
:sync_partitions
).
never
described_class
.
sync_partitions_ignore_db_error
end
end
end
describe
'.sync_partitions'
do
let
(
:table_names
)
{
%w[partitioning_test1 partitioning_test2]
}
let
(
:models
)
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