diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index 7607b4e..d3a16cc 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -193,7 +193,7 @@ protected function setUp() { } $this->kernel->boot(); - // Ensure database tasks have been run. + // Ensure database install tasks have been run. require_once __DIR__ . '/../../../includes/install.inc'; $connection = Database::getConnection(); $errors = db_installer_object($connection->driver())->runTasks(); @@ -201,10 +201,10 @@ protected function setUp() { $this->fail('Failed to run installer database tasks: ' . implode(', ', $errors)); } - // After running the database tasks we have to reboot the container so that - // a new database connection is created on the container. This prevents any - // services created during the first boot from having stale database - // connections, for example, \Drupal\Core\Config\DatabaseStorage. + // 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();