Closed
Description
I'm getting non-deterministic results for a regression test in unordered-containers
.
You can find the code at https://github.com/sjakobi/unordered-containers/tree/nothunks-issue. Run the test with
$ cabal run tests -- -p issue383
With GHC 9.2.2 I'm getting failures and successes in roughly equal proportion.
If I remove the source of randomness in the test with
--- a/tests/Regressions.hs
+++ b/tests/Regressions.hs
@@ -198,7 +198,7 @@ instance Functor MyIdentity where
issue383 :: Assertion
issue383 = do
- i :: Int <- randomIO
+ let i :: Int = 42
let f Nothing = MyIdentity (Just (show i))
f Just{} = MyIdentity (error "Nah")
let (MyIdentity m) = HMS.alterF f () mempty
… I get consistent successes with GHC 9.2.2 and consistent failures with GHC 9.0.2.
The expected test result is a success, independent of the value of i
.
Metadata
Metadata
Assignees
Labels
No labels