Fix a git-annex test failure when run on NFS due to NFS lock files preventing directory removal.

Should fix this:

    lock (v6 --force):                                    FAIL
      Exception: .git/annex/keys: removeDirectoryRecursive: unsatisfied constraints (Directory not empty)

Verified that the test case still catches the regression it's meant to.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2017-08-14 15:11:42 -04:00
parent 0b307f43e1
commit af6068525a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 4 additions and 0 deletions

View file

@ -5,6 +5,8 @@ git-annex (6.20170521) UNRELEASED; urgency=medium
* Added GIT_ANNEX_VECTOR_CLOCK environment variable, which can be used to * Added GIT_ANNEX_VECTOR_CLOCK environment variable, which can be used to
override the default timestamps used in log files in the git-annex override the default timestamps used in log files in the git-annex
branch. This is a dangerous environment variable; use with caution. branch. This is a dangerous environment variable; use with caution.
* Fix a git-annex test failure when run on NFS due to NFS lock files
preventing directory removal.
-- Joey Hess <id@joeyh.name> Sat, 17 Jun 2017 13:02:24 -0400 -- Joey Hess <id@joeyh.name> Sat, 17 Jun 2017 13:02:24 -0400

View file

@ -70,6 +70,7 @@ import qualified Types.Messages
import qualified Config import qualified Config
import qualified Config.Cost import qualified Config.Cost
import qualified Crypto import qualified Crypto
import qualified Database.Keys
import qualified Annex.WorkTree import qualified Annex.WorkTree
import qualified Annex.Link import qualified Annex.Link
import qualified Annex.Init import qualified Annex.Init
@ -652,6 +653,7 @@ test_lock_v6_force = intmpclonerepoInDirect $ do
git_annex "get" [annexedfile] @? "get of file failed" git_annex "get" [annexedfile] @? "get of file failed"
git_annex "unlock" [annexedfile] @? "unlock failed in v6 mode" git_annex "unlock" [annexedfile] @? "unlock failed in v6 mode"
annexeval $ do annexeval $ do
Database.Keys.closeDb
dbdir <- Annex.fromRepo Annex.Locations.gitAnnexKeysDb dbdir <- Annex.fromRepo Annex.Locations.gitAnnexKeysDb
liftIO $ removeDirectoryRecursive dbdir liftIO $ removeDirectoryRecursive dbdir
writeFile annexedfile "test_lock_v6_force content" writeFile annexedfile "test_lock_v6_force content"