From 89ac32616f353ce1a5a802902b4aa1901bb01e7c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 31 Oct 2018 08:04:16 -0400 Subject: [PATCH] don't move keys db out from under sqlite Instead remove enough data from it that this regression test tests what it needs to. Moving the database was the last thing that made the test suite unstable, including sometimes hanging completely. It seems that, despite closeDb being called before the move, sqlite was not quite done with it, and somehow this causes other sqlite handles to become unstable. Not good. With this change, the test suite has successfully run 100+ times without any issues. --- Test.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Test.hs b/Test.hs index 0e3df89530..4b03346e3a 100644 --- a/Test.hs +++ b/Test.hs @@ -650,9 +650,10 @@ test_lock_v7_force = intmpclonerepoInDirect $ do git_annex "get" [annexedfile] @? "get of file failed" git_annex "unlock" [annexedfile] @? "unlock failed in v7 mode" annexeval $ do + Just k <- Annex.WorkTree.lookupFile annexedfile + Database.Keys.removeInodeCaches k Database.Keys.closeDb - dbdir <- Annex.fromRepo Annex.Locations.gitAnnexKeysDb - liftIO $ renameDirectory dbdir (dbdir ++ ".old") + liftIO . nukeFile =<< Annex.fromRepo Annex.Locations.gitAnnexKeysDbIndexCache writecontent annexedfile "test_lock_v7_force content" git_annex_shouldfail "lock" [annexedfile] @? "lock of modified file failed to fail in v7 mode" git_annex "lock" ["--force", annexedfile] @? "lock --force of modified file failed in v7 mode"