Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup with buildTestBracketed too early #51

Open
gisenmann opened this issue Jun 3, 2013 · 0 comments
Open

cleanup with buildTestBracketed too early #51

gisenmann opened this issue Jun 3, 2013 · 0 comments

Comments

@gisenmann
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant