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.
This commit is contained in:
parent
1c71f563e0
commit
89ac32616f
1 changed files with 3 additions and 2 deletions
5
Test.hs
5
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"
|
||||
|
|
Loading…
Reference in a new issue