Skip to content

cleanup with buildTestBracketed too early #51

@gisenmann

Description

@gisenmann

I played with the buildTestBracketed feature today and got the impression,
that the cleanup happens too early.

My guess is, that cleanup should only be called after taking all mvars:

diff --git a/core/Test/Framework/Runners/Core.hs b/core/Test/Framework/Runners/Core.hs
index 6e15b0a..42db5b7 100644
--- a/core/Test/Framework/Runners/Core.hs
+++ b/core/Test/Framework/Runners/Core.hs
@@ -105,7 +105,7 @@ instance TestRunner StdRunner where
                 --
                 -- FIXME: this is a bit of a hack because it uses one pool thread just waiting
                 -- for some other pool threads to complete! Switch to parallel-io?
-                return $ Just (run_test, actions' ++ [(cleanup >> mapM_ takeMVar mvars)])
+                return $ Just (run_test, actions' ++ [(mapM_ takeMVar mvars >> cleanup)])

 runTests' :: [StdRunner] -> IO ([RunningTest], [IO ()])
 runTests' = fmap (onRight concat . unzip . catMaybes) . mapM run

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions