Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443205
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-3443205
Commits
d7509fae
Commit
d7509fae
authored
9 years ago
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2565241
by alexpott: First test fails on postgres because of a stale connection
parent
a2059f62
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/simpletest/src/KernelTestBase.php
+16
-8
16 additions, 8 deletions
core/modules/simpletest/src/KernelTestBase.php
with
16 additions
and
8 deletions
core/modules/simpletest/src/KernelTestBase.php
+
16
−
8
View file @
d7509fae
...
@@ -190,6 +190,22 @@ protected function setUp() {
...
@@ -190,6 +190,22 @@ protected function setUp() {
}
}
$this
->
kernel
->
boot
();
$this
->
kernel
->
boot
();
// Ensure database install tasks have been run.
require_once
__DIR__
.
'/../../../includes/install.inc'
;
$connection
=
Database
::
getConnection
();
$errors
=
db_installer_object
(
$connection
->
driver
())
->
runTasks
();
if
(
!
empty
(
$errors
))
{
$this
->
fail
(
'Failed to run installer database tasks: '
.
implode
(
', '
,
$errors
));
}
// Reboot the kernel because the container might contain a connection to the
// database that has been closed during the database install tasks. This
// prevents any services created during the first boot from having stale
// database connections, for example, \Drupal\Core\Config\DatabaseStorage.
$this
->
kernel
->
shutdown
();
$this
->
kernel
->
boot
();
// Save the original site directory path, so that extensions in the
// Save the original site directory path, so that extensions in the
// site-specific directory can still be discovered in the test site
// site-specific directory can still be discovered in the test site
// environment.
// environment.
...
@@ -222,14 +238,6 @@ protected function setUp() {
...
@@ -222,14 +238,6 @@ protected function setUp() {
// the event dispatcher which can prevent modules from registering events.
// the event dispatcher which can prevent modules from registering events.
\Drupal
::
service
(
'config.storage'
)
->
write
(
'core.extension'
,
array
(
'module'
=>
array
(),
'theme'
=>
array
()));
\Drupal
::
service
(
'config.storage'
)
->
write
(
'core.extension'
,
array
(
'module'
=>
array
(),
'theme'
=>
array
()));
// Ensure database tasks have been run.
require_once
__DIR__
.
'/../../../includes/install.inc'
;
$connection
=
Database
::
getConnection
();
$errors
=
db_installer_object
(
$connection
->
driver
())
->
runTasks
();
if
(
!
empty
(
$errors
))
{
$this
->
fail
(
'Failed to run installer database tasks: '
.
implode
(
', '
,
$errors
));
}
// Collect and set a fixed module list.
// Collect and set a fixed module list.
$class
=
get_class
(
$this
);
$class
=
get_class
(
$this
);
$modules
=
array
();
$modules
=
array
();
...
...
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