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

Test failure on policy transformers #78

Open
paulvictor opened this issue May 4, 2022 · 3 comments
Open

Test failure on policy transformers #78

paulvictor opened this issue May 4, 2022 · 3 comments

Comments

@paulvictor
Copy link

I am trying to build retry, and I ended up with a test failure

   policy transformers
      always produces positive delay with positive constants (no rollover):          FAIL (0.69s)
          ✗ always produces positive delay with positive constants (no rollover) failed at test/Tests/Control/Retry.hs:221:11
            after 2 tests and 57 shrinks.

                ┏━━ test/Tests/Control/Retry.hs ━━━
            208 ┃ policyTransformersTests :: TestTree
            209 ┃ policyTransformersTests = testGroup "policy transformers"
            210 ┃   [ testProperty "always produces positive delay with positive constants (no rollover)" $ property $ do
            211 ┃       delay <- forAll (Gen.int (Range.linear 0 maxBound))
                ┃       │ 1
            212 ┃       let res = runIdentity (simulatePolicy 1000 (exponentialBackoff delay))
            213 ┃           delays = catMaybes (snd <$> res)
            214 ┃           mnDelay = if null delays
            215 ┃                       then Nothing
            216 ┃                       else Just (minimum delays)
            217 ┃       case mnDelay of
            218 ┃         Nothing -> return ()
            219 ┃         Just n -> do
            220 ┃           footnote (show n ++ " is not >= 0")
            221 ┃           HH.assert (n >= 0)
                ┃           ^^^^^^^^^^^^^^^^^^
            222 ┃   , testProperty "positive, nonzero exponential backoff is always incrementing" $ property $ do
            223 ┃      delay <- forAll (Gen.int (Range.linear 1 maxBound))
            224 ┃      let res = runIdentity (simulatePolicy 1000 (limitRetriesByDelay maxBound (exponentialBackoff delay)))
            225 ┃          delays = catMaybes (snd <$> res)
            226 ┃      sort delays === delays
            227 ┃      length (group delays) === length delays
            228 ┃   ]

            -9223372036854775808 is not >= 0

            This failure can be reproduced by running:
            > recheck (Size 1) (Seed 17647478776705613149 5015347513854265309) always produces positive delay with positive constants (no rollover)

        Use '--hedgehog-replay "Size 1 Seed 17647478776705613149 5015347513854265309"' to reproduce.

        Use -p '/always produces positive delay with positive constants (no rollover)/' to rerun this test only.
      positive, nonzero exponential backoff is always incrementing:                  FAIL (0.41s)
          ✗ positive, nonzero exponential backoff is always incrementing failed at test/Tests/Control/Retry.hs:226:18
            after 1 test.

                ┏━━ test/Tests/Control/Retry.hs ━━━
            208 ┃ policyTransformersTests :: TestTree
            209 ┃ policyTransformersTests = testGroup "policy transformers"
            210 ┃   [ testProperty "always produces positive delay with positive constants (no rollover)" $ property $ do
            211 ┃       delay <- forAll (Gen.int (Range.linear 0 maxBound))
            212 ┃       let res = runIdentity (simulatePolicy 1000 (exponentialBackoff delay))
            213 ┃           delays = catMaybes (snd <$> res)
            214 ┃           mnDelay = if null delays
            215 ┃                       then Nothing
            216 ┃                       else Just (minimum delays)
            217 ┃       case mnDelay of
            218 ┃         Nothing -> return ()
            219 ┃         Just n -> do
            220 ┃           footnote (show n ++ " is not >= 0")
            221 ┃           HH.assert (n >= 0)
            222 ┃   , testProperty "positive, nonzero exponential backoff is always incrementing" $ property $ do
            223 ┃      delay <- forAll (Gen.int (Range.linear 1 maxBound))
                ┃      │ 1
            224 ┃      let res = runIdentity (simulatePolicy 1000 (limitRetriesByDelay maxBound (exponentialBackoff delay)))
            225 ┃          delays = catMaybes (snd <$> res)
            226 ┃      sort delays === delays
                ┃      ^^^^^^^^^^^^^^^^^^^^^^
... with a very big array
... followed by

           This failure can be reproduced by running:
            > recheck (Size 2) (Seed 10571801305957791816 9377426414140356069) never exceeds the given cumulative delay

        Use '--hedgehog-replay "Size 2 Seed 10571801305957791816 9377426414140356069"' to reproduce.

        Use -p '/never exceeds the given cumulative delay/' to rerun this test only.


@natsukagami
Copy link

This is related to https://gitlab.haskell.org/ghc/ghc/-/issues/21624, a compiler backend bug.

@MichaelXavier
Copy link
Contributor

Maybe @paulvictor can keep an eye on the GHC bug and try again when the fix is available. Or we could close the ticket.

@pwm
Copy link

pwm commented Nov 13, 2022

This seems to be fixed now?

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

4 participants