From d0fecb79851a9ea7b61acfe1082c43344a5289bc Mon Sep 17 00:00:00 2001
From: Dave Long <dave@longwaveconsulting.com>
Date: Sun, 18 Feb 2024 11:42:40 +0000
Subject: [PATCH] Issue #3417816 by Watergate: Ensure database connection
 information is cleaned up properly after performing ConnectionTest

---
 .../Drupal/Tests/Core/Database/ConnectionTest.php     | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php b/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php
index 7447460984eb..38e0f199c689 100644
--- a/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php
@@ -982,4 +982,15 @@ public function testDeprecatedFetchModes(int $mode): void {
     $statement->setFetchMode($mode);
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function tearDown(): void {
+    parent::tearDown();
+
+    // Removes the default connection added by the
+    // testFindCallerFromDebugBacktrace test.
+    Database::removeConnection('default');
+  }
+
 }
-- 
GitLab