cats-effect-testing icon indicating copy to clipboard operation
cats-effect-testing copied to clipboard

Make ScalaTest retrying effect generic

Open bcarter97 opened this issue 1 year ago • 3 comments

  • Closes #471

bcarter97 avatar Jun 29 '23 22:06 bcarter97

Failing binary compatibility:

method ioRetrying()org.scalatest.enablers.Retrying in interface cats.effect.testing.scalatest.AsyncIOSpec does not have a correspondent in current version

So it's the naming - not sure whether to rename it ioRetrying (it's not IO anymore) for binary compatibility or add ioRetrying implemented with fRetrying, which might cause ambiguous implicit resolution.

After some testing I think having an ioRetrying in terms of fRetrying is fine:

def foo[F[_]: Async, T](t: T): F[T] = Async[F].pure(t)

// resolves ioRetrying implicit
def eventuallyIO: IO[String] = {
  eventually {
    foo[IO, String]("hello")
  }
}

// resolves fRetrying implicit
def eventuallyF[F[_]: Async]: F[String] = {
  eventually {
    foo[F, String]("hello")
  }
}

bcarter97 avatar Jul 01 '23 15:07 bcarter97

@sh0hei I think you approved the last build, is it possible to approve again?

bcarter97 avatar Jul 03 '23 17:07 bcarter97

@sh0hei any chance you can run the build? Otherwise if this is deemed no longer necessary I can close it.

bcarter97 avatar Dec 20 '23 21:12 bcarter97