From 261583a0bdef9cabd7f75782bfd5d54caec50448 Mon Sep 17 00:00:00 2001
From: Cam Saul <cam@geotip.com>
Date: Tue, 30 Jun 2015 16:15:04 -0700
Subject: [PATCH] fix the mongo connection error

---
 test/metabase/test/data/mongo.clj | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/metabase/test/data/mongo.clj b/test/metabase/test/data/mongo.clj
index 8c12a2b6e86..9a902810e3b 100644
--- a/test/metabase/test/data/mongo.clj
+++ b/test/metabase/test/data/mongo.clj
@@ -22,8 +22,8 @@
   (create-physical-db! [_ _])
 
   (drop-physical-db! [this database-definition]
-    (mg/drop-db (mg/connect (database->connection-details this database-definition))
-                (escaped-name database-definition)))
+    (with-open [mongo-connection (mg/connect (database->connection-details this database-definition))]
+      (mg/drop-db mongo-connection (escaped-name database-definition))))
 
   ;; Nothing to do here, collection is created when we add documents to it
   (create-physical-table! [_ _ _])
-- 
GitLab