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

CI Test Errors FiniteDuration antisymmetry #3734

Closed
Slakah opened this issue Jan 13, 2021 · 4 comments
Closed

CI Test Errors FiniteDuration antisymmetry #3734

Slakah opened this issue Jan 13, 2021 · 4 comments
Milestone

Comments

@Slakah
Copy link
Contributor

Slakah commented Jan 13, 2021

Some CI failures on Scala 3.

CI failure from #3727 :

Click to expand!
failing seed for order.antisymmetry eq is tJVxJ6pgwg7UrNv9sWAqwY4eokyiECpCf8K9kK8SQhC=
failing seed for order.antisymmetry eq is tJVxJ6pgwg7UrNv9sWAqwY4eokyiECpCf8K9kK8SQhC=
==> X cats.kernel.laws.Tests.Order[FiniteDuration]: order.antisymmetry eq  0.046s munit.FailException: /home/runner/work/cats/cats/kernel-laws/shared/src/test/scala/cats/kernel/laws/LawTests.scala:201
200:  checkAll("Order[Duration]", OrderTests[Duration].order)
201:  checkAll("Order[FiniteDuration]", OrderTests[FiniteDuration].order)
202:  checkAll("Order[UUID]", OrderTests[UUID].order)

CI failure from #3730 :

Click to expand!
failing seed for hash.antisymmetry eq is tJ9I1dkawrvX2DEc6NGtz5qNQw96EBLm1nV0-XvgFmA=
==> X cats.kernel.laws.Tests.Hash[FiniteDuration]: hash.antisymmetry eq  0.028s munit.FailException: /home/runner/work/cats/cats/kernel-laws/shared/src/test/scala/cats/kernel/laws/LawTests.scala:299
298:  checkAll("Hash[Duration]", HashTests[Duration].hash)
299:  checkAll("Hash[FiniteDuration]", HashTests[FiniteDuration].hash)
300:

Failing seed: 5MC5_eL2QrqZQkkWTTuITf7k9M0Wy1b5-RAvsNJZxHO=
You can reproduce this failure by adding the following override to your suite:

  override val scalaCheckInitialSeed = "5MC5_eL2QrqZQkkWTTuITf7k9M0Wy1b5-RAvsNJZxHO="

Falsified after 62 passed tests.
> Labels of failing property: 
Expected: true
Received: false
> ARG_0: -3888 hours
> ARG_1: -162 days
> ARG_2: org.scalacheck.GenArities$$Lambda$458/12131917@1f846122

@rossabaker
Copy link
Member

Thanks for capturing these! Note that in both cases, the arguments are equal, but have different units:

@ 114.days === 2736.hours 
res12: Boolean = true

@ -162.days === -3888.hours 
res13: Boolean = true

That suggests a problem with the Cogen instance, whereupon we find #3470, and its reversion in #3694.

Does the plot thicken with Scala 3?

@larsrh
Copy link
Contributor

larsrh commented Feb 6, 2021

@TimWSpence also observed this in #3762. I'm tempted to agree that either antiSymmetryEq should go, or the Cogen instance for FiniteDuration is borked.

@larsrh
Copy link
Contributor

larsrh commented Feb 6, 2021

Fixed by #3772.

@larsrh larsrh closed this as completed Feb 6, 2021
@TimWSpence
Copy link
Member

@TimWSpence also observed this in #3762. I'm tempted to agree that either antiSymmetryEq should go, or the Cogen instance for FiniteDuration is borked.

Thanks for capturing these! Note that in both cases, the arguments are equal, but have different units:

@ 114.days === 2736.hours 
res12: Boolean = true

@ -162.days === -3888.hours 
res13: Boolean = true

That suggests a problem with the Cogen instance, whereupon we find #3470, and its reversion in #3694.

Does the plot thicken with Scala 3?

@rossabaker What difference does scala 3 make sorry? The law seems somewhat fundamentally broken to me - if you have a non-trivial Eq instance like FiniteDuration then you can write perfectly reasonable functions that aren't well defined wrt Eq (ie x == y does not imply f x == f y) eg by pattern-matching on the time unit like in the Cogen instance above

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