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
a3580e1e
Commit
a3580e1e
authored
May 07, 2021
by
Furkan Ayhan
Committed by
Gabriel Mazetto
May 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix N+1 test of pipeline seed
parent
27621069
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
spec/lib/gitlab/ci/pipeline/chain/seed_spec.rb
spec/lib/gitlab/ci/pipeline/chain/seed_spec.rb
+6
-3
No files found.
spec/lib/gitlab/ci/pipeline/chain/seed_spec.rb
View file @
a3580e1e
...
...
@@ -218,15 +218,18 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
end
context
'N+1 queries'
do
it
'avoids N+1 queries when calculating variables of jobs'
do
it
'avoids N+1 queries when calculating variables of jobs'
,
:use_sql_query_cache
do
warm_up_pipeline
,
warm_up_command
=
prepare_pipeline1
perform_seed
(
warm_up_pipeline
,
warm_up_command
)
pipeline1
,
command1
=
prepare_pipeline1
pipeline2
,
command2
=
prepare_pipeline2
control
=
ActiveRecord
::
QueryRecorder
.
new
do
control
=
ActiveRecord
::
QueryRecorder
.
new
(
skip_cached:
false
)
do
perform_seed
(
pipeline1
,
command1
)
end
expect
{
perform_seed
(
pipeline2
,
command2
)
}.
not_to
exceed_query_limit
(
expect
{
perform_seed
(
pipeline2
,
command2
)
}.
not_to
exceed_
all_
query_limit
(
control
.
count
+
expected_extra_queries
)
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