Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3411111
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-3411111
Commits
a3f1255f
Verified
Commit
a3f1255f
authored
1 year ago
by
Lee Rowlands
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3410312
by catch: Flood database backend ::isAllowed() should call ::ensureTableExists()
parent
04900c3c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/lib/Drupal/Core/Flood/DatabaseBackend.php
+3
-1
3 additions, 1 deletion
core/lib/Drupal/Core/Flood/DatabaseBackend.php
core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
+7
-6
7 additions, 6 deletions
...ests/src/FunctionalJavascript/StandardPerformanceTest.php
with
10 additions
and
7 deletions
core/lib/Drupal/Core/Flood/DatabaseBackend.php
+
3
−
1
View file @
a3f1255f
...
@@ -140,7 +140,9 @@ public function isAllowed($name, $threshold, $window = 3600, $identifier = NULL)
...
@@ -140,7 +140,9 @@ public function isAllowed($name, $threshold, $window = 3600, $identifier = NULL)
return
(
$number
<
$threshold
);
return
(
$number
<
$threshold
);
}
}
catch
(
\Exception
$e
)
{
catch
(
\Exception
$e
)
{
$this
->
catchException
(
$e
);
if
(
!
$this
->
ensureTableExists
())
{
throw
$e
;
}
return
TRUE
;
return
TRUE
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
+
7
−
6
View file @
a3f1255f
...
@@ -60,7 +60,7 @@ public function testAnonymous() {
...
@@ -60,7 +60,7 @@ public function testAnonymous() {
// the highest and lowest number of observed during test runs.
// the highest and lowest number of observed during test runs.
// See https://www.drupal.org/project/drupal/issues/3402610
// See https://www.drupal.org/project/drupal/issues/3402610
$this
->
assertGreaterThanOrEqual
(
58
,
$performance_data
->
getQueryCount
());
$this
->
assertGreaterThanOrEqual
(
58
,
$performance_data
->
getQueryCount
());
$this
->
assertLessThanOrEqual
(
6
7
,
$performance_data
->
getQueryCount
());
$this
->
assertLessThanOrEqual
(
6
8
,
$performance_data
->
getQueryCount
());
$this
->
assertGreaterThanOrEqual
(
129
,
$performance_data
->
getCacheGetCount
());
$this
->
assertGreaterThanOrEqual
(
129
,
$performance_data
->
getCacheGetCount
());
$this
->
assertLessThanOrEqual
(
132
,
$performance_data
->
getCacheGetCount
());
$this
->
assertLessThanOrEqual
(
132
,
$performance_data
->
getCacheGetCount
());
$this
->
assertGreaterThanOrEqual
(
59
,
$performance_data
->
getCacheSetCount
());
$this
->
assertGreaterThanOrEqual
(
59
,
$performance_data
->
getCacheSetCount
());
...
@@ -131,7 +131,7 @@ public function testLogin(): void {
...
@@ -131,7 +131,7 @@ public function testLogin(): void {
// random test failures, assert greater than equal the highest and lowest
// random test failures, assert greater than equal the highest and lowest
// number of queries observed during test runs.
// number of queries observed during test runs.
// See https://www.drupal.org/project/drupal/issues/3402610
// See https://www.drupal.org/project/drupal/issues/3402610
$this
->
assertLessThanOrEqual
(
42
,
$performance_data
->
getQueryCount
());
$this
->
assertLessThanOrEqual
(
39
,
$performance_data
->
getQueryCount
());
$this
->
assertGreaterThanOrEqual
(
39
,
$performance_data
->
getQueryCount
());
$this
->
assertGreaterThanOrEqual
(
39
,
$performance_data
->
getQueryCount
());
$this
->
assertSame
(
28
,
$performance_data
->
getCacheGetCount
());
$this
->
assertSame
(
28
,
$performance_data
->
getCacheGetCount
());
$this
->
assertLessThanOrEqual
(
2
,
$performance_data
->
getCacheSetCount
());
$this
->
assertLessThanOrEqual
(
2
,
$performance_data
->
getCacheSetCount
());
...
@@ -163,14 +163,15 @@ public function testLoginBlock(): void {
...
@@ -163,14 +163,15 @@ public function testLoginBlock(): void {
$performance_data
=
$this
->
collectPerformanceData
(
function
()
use
(
$account
)
{
$performance_data
=
$this
->
collectPerformanceData
(
function
()
use
(
$account
)
{
$this
->
submitLoginForm
(
$account
);
$this
->
submitLoginForm
(
$account
);
});
});
$this
->
assertLessThanOrEqual
(
5
1
,
$performance_data
->
getQueryCount
());
$this
->
assertLessThanOrEqual
(
5
0
,
$performance_data
->
getQueryCount
());
$this
->
assertGreaterThanOrEqual
(
48
,
$performance_data
->
getQueryCount
());
$this
->
assertGreaterThanOrEqual
(
48
,
$performance_data
->
getQueryCount
());
$this
->
assertSame
(
30
,
$performance_data
->
getCacheGetCount
());
// This test observes a variable number of cache operations, so to avoid random
// This test observes a variable number of cache sets, so to avoid random
// test failures, assert greater than equal the highest and lowest number
// test failures, assert greater than equal the highest and lowest number
// observed during test runs.
// observed during test runs.
// See https://www.drupal.org/project/drupal/issues/3402610
// See https://www.drupal.org/project/drupal/issues/3402610
$this
->
assertLessThanOrEqual
(
32
,
$performance_data
->
getCacheGetCount
());
$this
->
assertGreaterThanOrEqual
(
30
,
$performance_data
->
getCacheGetCount
());
$this
->
assertLessThanOrEqual
(
4
,
$performance_data
->
getCacheSetCount
());
$this
->
assertLessThanOrEqual
(
4
,
$performance_data
->
getCacheSetCount
());
$this
->
assertGreaterThanOrEqual
(
1
,
$performance_data
->
getCacheSetCount
());
$this
->
assertGreaterThanOrEqual
(
1
,
$performance_data
->
getCacheSetCount
());
$this
->
assertSame
(
1
,
$performance_data
->
getCacheDeleteCount
());
$this
->
assertSame
(
1
,
$performance_data
->
getCacheDeleteCount
());
...
...
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