diff --git a/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php b/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php
index 7447460984ebff55ba9e4bb369e4c33d720fea55..38e0f199c6896fc558ece327b238f4f0337b620b 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');
+  }
+
 }