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

Scalatest deadlocks very easily

Open m50d opened this issue 4 years ago • 5 comments

Minimal example: https://scastie.scala-lang.org/NU86Wy4kTTukZzaSTUM2VA I think this is because AsyncIOSpec passes scalatest's executionContext which is serialExecutionContext and not really suitable for general-purpose use.

m50d avatar Mar 31 '21 09:03 m50d

Hmm, what's the ideal solution here? Is it better to just override ScalaTest's ExecutionContext? I don't actually use ScalaTest so I can't speak to its idiomatic usage.

djspiewak avatar May 24 '21 04:05 djspiewak

Overriding the executionContext seems to work. I avoid ScalaTest as much as possible myself TBH, I don't know what's considered idiomatic there.

m50d avatar May 25 '21 00:05 m50d

What should we override it with? The IORuntime default EC?

djspiewak avatar May 25 '21 01:05 djspiewak

Sounds reasonable to me.

m50d avatar May 25 '21 02:05 m50d

Alrighty, it's duly on my todo list (PRs welcome if someone gets to it first!)

djspiewak avatar May 25 '21 02:05 djspiewak