Closed bolt12 closed 11 months ago
You don't need env (evaluate (force (a, m))
, a simple env (pure (a, m))
would suffice, because env
forces the resource internally:
https://github.com/Bodigrim/tasty-bench/blob/53d59f97b272152e6bba3fbd466a68377cba8956/src/Test/Tasty/Bench.hs#L1621-L1624
(It seems the documentation of env
is misleading, it can use a fix)
tasty-bench
defers resource management to tasty
. Is it possible to reproduce the issue with tasty
itself?
Thank you for your prompt reply! I changed the code to use just pure
but the same issue, remains.
tasty-bench defers resource management to tasty. Is it possible to reproduce the issue with tasty itself?
What do you mean, tasty
does not have any env
function, only withResource
which has a very different type signature. How can I try to reproduce the issue with tasty, given that I believe the issue is in env
?
env
is a thin wrapper over withResource
. If you inline env
and underlying envWithCleanup
, you'll obtain a reproducer via withResource
. You can further simplify your example replacing bench
with a simpler test ingredient, say testCase
.
Thank you! Yes I tried that and still get the same problem. I inlined everything up to withResource
and used something other than bench
, but no success
So if it's not tasty-bench
specific, could you forward the issue to tasty
issue tracker?
Please see this comment: https://github.com/UnkindPartition/tasty/issues/401#issuecomment-1818764402
I have the following code:
ignoring the details specific to my code, this is a function that generates benchmarks. I want to force evaluate some of the inputs which are pure values, an as you can see, the name of the benchmarks is not dependent on the IO action. Also the benchmark hierarchy is not dependent on it as well. What's weirder is that if I only evaluate on element of the tuple (i.e. either
a
orm
) the code works, but as soon as I tuple them it doesn't work givingbench: Unhandled resource. Probably a bug in the runner you're using.
is this a bug?