Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3101671
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3101671
Commits
4b5cc115
Verified
Commit
4b5cc115
authored
1 year ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3406707
by catch: Increase range of db query assertions
parent
b078bec0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
+21
-15
21 additions, 15 deletions
...ests/src/FunctionalJavascript/StandardPerformanceTest.php
with
21 additions
and
15 deletions
core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
+
21
−
15
View file @
4b5cc115
...
...
@@ -53,16 +53,16 @@ public function testAnonymous() {
$this
->
drupalGet
(
''
);
});
$this
->
assertNoJavaScript
(
$performance_data
);
// This test observes a variable number of cache
gets and sets, so to avoid
// random test failures, assert greater than equal
the highest and lowest
// number of observed during test runs.
// This test observes a variable number of cache
operations and database
//
queries, so to avoid
random test failures, assert greater than equal
//
the highest and lowest
number of observed during test runs.
// See https://www.drupal.org/project/drupal/issues/3402610
$this
->
assertGreaterThanOrEqual
(
58
,
$performance_data
->
getQueryCount
());
$this
->
assertLessThanOrEqual
(
66
,
$performance_data
->
getQueryCount
());
$this
->
assertLessThanOrEqual
(
67
,
$performance_data
->
getQueryCount
());
$this
->
assertGreaterThanOrEqual
(
129
,
$performance_data
->
getCacheGetCount
());
$this
->
assertLessThanOrEqual
(
132
,
$performance_data
->
getCacheGetCount
());
$this
->
assertSame
(
59
,
$performance_data
->
getCacheSetCount
());
$this
->
assertGreaterThanOrEqual
(
59
,
$performance_data
->
getCacheSetCount
());
$this
->
assertLessThanOrEqual
(
68
,
$performance_data
->
getCacheSetCount
());
$this
->
assertSame
(
0
,
$performance_data
->
getCacheDeleteCount
());
// Test node page.
...
...
@@ -70,15 +70,18 @@ public function testAnonymous() {
$this
->
drupalGet
(
'node/1'
);
});
$this
->
assertNoJavaScript
(
$performance_data
);
$this
->
assertSame
(
38
,
$performance_data
->
getQueryCount
());
// This test observes a variable number of cache
gets and sets, so to avoid
// random test failures, assert greater than equal
the highest and lowest
// number of
queries
observed during test runs.
// This test observes a variable number of cache
operations and database
//
queries, so to avoid
random test failures, assert greater than equal
//
the highest and lowest
number of observed during test runs.
// See https://www.drupal.org/project/drupal/issues/3402610
$this
->
assertGreaterThanOrEqual
(
38
,
$performance_data
->
getQueryCount
());
$this
->
assertLessThanOrEqual
(
39
,
$performance_data
->
getQueryCount
());
$this
->
assertGreaterThanOrEqual
(
87
,
$performance_data
->
getCacheGetCount
());
$this
->
assertLessThanOrEqual
(
88
,
$performance_data
->
getCacheGetCount
());
$this
->
assertSame
(
20
,
$performance_data
->
getCacheSetCount
());
$this
->
assertGreaterThanOrEqual
(
20
,
$performance_data
->
getCacheSetCount
());
$this
->
assertLessThanOrEqual
(
28
,
$performance_data
->
getCacheSetCount
());
$this
->
assertSame
(
0
,
$performance_data
->
getCacheDeleteCount
());
// Test user profile page.
...
...
@@ -95,7 +98,8 @@ public function testAnonymous() {
// See https://www.drupal.org/project/drupal/issues/3402610
$this
->
assertGreaterThanOrEqual
(
74
,
$performance_data
->
getCacheGetCount
());
$this
->
assertLessThanOrEqual
(
80
,
$performance_data
->
getCacheGetCount
());
$this
->
assertSame
(
19
,
$performance_data
->
getCacheSetCount
());
$this
->
assertGreaterThanOrEqual
(
19
,
$performance_data
->
getCacheSetCount
());
$this
->
assertLessThanOrEqual
(
27
,
$performance_data
->
getCacheSetCount
());
$this
->
assertSame
(
0
,
$performance_data
->
getCacheDeleteCount
());
}
...
...
@@ -125,10 +129,11 @@ public function testLogin(): void {
// random test failures, assert greater than equal the highest and lowest
// number of queries observed during test runs.
// See https://www.drupal.org/project/drupal/issues/3402610
$this
->
assertLessThanOrEqual
(
4
0
,
$performance_data
->
getQueryCount
());
$this
->
assertLessThanOrEqual
(
4
2
,
$performance_data
->
getQueryCount
());
$this
->
assertGreaterThanOrEqual
(
39
,
$performance_data
->
getQueryCount
());
$this
->
assertSame
(
28
,
$performance_data
->
getCacheGetCount
());
$this
->
assertSame
(
1
,
$performance_data
->
getCacheSetCount
());
$this
->
assertLessThanOrEqual
(
2
,
$performance_data
->
getCacheSetCount
());
$this
->
assertGreaterThanOrEqual
(
1
,
$performance_data
->
getCacheSetCount
());
$this
->
assertSame
(
1
,
$performance_data
->
getCacheDeleteCount
());
}
...
...
@@ -156,7 +161,8 @@ public function testLoginBlock(): void {
$performance_data
=
$this
->
collectPerformanceData
(
function
()
use
(
$account
)
{
$this
->
submitLoginForm
(
$account
);
});
$this
->
assertSame
(
48
,
$performance_data
->
getQueryCount
());
$this
->
assertLessThanOrEqual
(
51
,
$performance_data
->
getQueryCount
());
$this
->
assertGreaterThanOrEqual
(
48
,
$performance_data
->
getQueryCount
());
$this
->
assertSame
(
30
,
$performance_data
->
getCacheGetCount
());
// This test observes a variable number of cache sets, so to avoid random
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment