diff --git a/test/offline/db_upgrade_from_version_1_unit.js b/test/offline/db_upgrade_from_version_1_unit.js
index <HASH>..<HASH> 100644
--- a/test/offline/db_upgrade_from_version_1_unit.js
+++ b/test/offline/db_upgrade_from_version_1_unit.js
@@ -452,6 +452,12 @@ describe('DBUpgradeFromVersion1', function() {
                       segments,
                       newSegment);
                 });
+              })
+              .then(function() {
+                // Make sure to close the database when we are done or else any
+                // following test that tries to delete this database will hang
+                // when trying to delete it.
+                db.close();
               });
         });
   }
Close Database After Upgrade Test

On Safari it seems that deleting a database that was opened in a
previous test causes the delete call to hang. This makes sure
we close the database after each upgrade test.

Change-Id: Ie<I>a<I>bd<I>cef<I>ee<I>f<I>d8a1a<I>