diff --git a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
index 7ff31796d4bfc4604634eb9059a4b4af6412ca84..1d735d511def5552ddb76a1261c101c2c16782f2 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
@@ -31,12 +31,14 @@ class EndOfTransactionQueriesTest extends KernelTestBase {
    * {@inheritdoc}
    */
   protected function setUp(): void {
+    parent::setUp();
+
+    // This can only be checked after installing Drupal as it requires functions
+    // from bootstrap.inc.
     if (!class_exists($this->getDatabaseConnectionInfo()['default']['namespace'] . '\Connection')) {
       $this->markTestSkipped(sprintf('No logging override exists for the %s database driver. Create it, subclass this test class and override ::getDatabaseConnectionInfo().', $this->getDatabaseConnectionInfo()['default']['driver']));
     }
 
-    parent::setUp();
-
     $this->installSchema('system', 'sequences');
     $this->installEntitySchema('entity_test');
     $this->installEntitySchema('user');