Bug#924800: [PATCH] resolve race in test cleanup by making second attempt more forceful

Sean Whitton spwhitton at spwhitton.name
Sun Mar 31 20:34:42 BST 2019


Errors are like this:

    .t/gpgtest/9/S.gpg-agent.extra: removeDirectoryRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:r emovePathRecursive:getSymbolicLinkStatus: does not exist (No such file or directory)

i.e. the problem seems to be files vanishing while
removeDirectoryRecursive is running.  removePathForcibly ignores such
errors.

Reported-by: Lucas Nussbaum <lucas at debian.org>
Signed-off-by: Sean Whitton <spwhitton at spwhitton.name>
---
 Test/Framework.hs | 2 +-
 git-annex.cabal   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Test/Framework.hs b/Test/Framework.hs
index 410eb6713..45bdf9374 100644
--- a/Test/Framework.hs
+++ b/Test/Framework.hs
@@ -271,7 +271,7 @@ finalCleanup = whenM (doesDirectoryExist tmpdir) $ do
 			Utility.ThreadScheduler.Seconds 10
 		whenM (doesDirectoryExist tmpdir) $ do
 			Annex.Action.reapZombies
-			removeDirectoryRecursive tmpdir
+			removePathForcibly tmpdir
 	
 checklink :: FilePath -> Assertion
 checklink f =
diff --git a/git-annex.cabal b/git-annex.cabal
index 9b7eb9516..653621580 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -313,7 +313,7 @@ Executable git-annex
    unix-compat,
    SafeSemaphore,
    async,
-   directory (>= 1.2),
+   directory (>= 1.2.7.0),
    disk-free-space,
    filepath,
    IfElse,
-- 
2.20.1



More information about the Pkg-haskell-maintainers mailing list