Open mwotton opened 7 years ago
This sounds really great.
@mwotton sorry for getting back late! Yes, I think we want to do something here in hspec
. Is the problem actually that hspec
catches these exceptions in the first place? My naive assumption is that if we let that exception hit the top-level we will get all the output we need. This has the disadvantage that the test suite fails hard, but on the other hand catching async exceptions is rarely the right thing to do (I'm actually even surprised that we catch this one. This may just be a bug).
We can consider this a bug. Our current approach is roughly based on https://www.schoolofhaskell.com/user/snoyberg/general-haskell/exceptions/catching-all-exceptions, which doesn't propagate StackOverflow
. @snoyberg's safe-exceptions
does not have this problem.
tbh it's long enough ago I can't actually remember what the problem was :)
I was automating some of https://neilmitchell.blogspot.de/2015/09/detecting-space-leaks.html and decided it'd be nice to have displays of stack traces in hspec when you get overflows. I ended up with this: https://gist.github.com/mwotton/775c01670e3844ba0ac596f0ae689d22
would there be any interest in folding it into hspec proper? It's easy enough to package separately (thanks for the combinators on the basic data structures, btw, made it quite simple), but it seems like something that's quite useful in general.