diff --git a/tests/jvm/src/test/scala/cats/effect/IOAppSpec.scala b/tests/jvm/src/test/scala/cats/effect/IOAppSpec.scala index 75688054fd..82b75f7a1a 100644 --- a/tests/jvm/src/test/scala/cats/effect/IOAppSpec.scala +++ b/tests/jvm/src/test/scala/cats/effect/IOAppSpec.scala @@ -203,20 +203,6 @@ class IOAppSpec extends Specification { h.stderr() must not(contain("boom")) } - "warn on cpu starvation" in { - val h = platform(CpuStarvation, List.empty) - h.awaitStatus() - val err = h.stderr() - err must not(contain("[WARNING] Failed to register Cats Effect CPU")) - err must contain("[WARNING] Your app's responsiveness") - // we use a regex because time has too many corner cases - a test run at just the wrong - // moment on new year's eve, etc - err must beMatching( - // (?s) allows matching across line breaks - """(?s)^\d{4}-[01]\d-[0-3]\dT[012]\d:[0-6]\d:[0-6]\d(?:\.\d{1,3})?Z \[WARNING\] Your app's responsiveness.*""" - ) - } - "custom runtime installed as global" in { val h = platform(CustomRuntime, List.empty) h.awaitStatus() mustEqual 0 @@ -285,6 +271,8 @@ class IOAppSpec extends Specification { "support main thread evaluation" in skipped( "JavaScript is all main thread, all the time") + "warn on cpu starvation" in skipped( + "starvation detection works on Node, but the test struggles with determinism") } else { val isJava8 = sys.props.get("java.version").filter(_.startsWith("1.8")).isDefined @@ -337,6 +325,19 @@ class IOAppSpec extends Specification { "[WARNING] A Cats Effect worker thread was detected to be in a blocked state") } + "warn on cpu starvation" in { + val h = platform(CpuStarvation, List.empty) + h.awaitStatus() + val err = h.stderr() + err must not(contain("[WARNING] Failed to register Cats Effect CPU")) + err must contain("[WARNING] Your app's responsiveness") + // we use a regex because time has too many corner cases - a test run at just the wrong + // moment on new year's eve, etc + err must beMatching( + // (?s) allows matching across line breaks + """(?s)^\d{4}-[01]\d-[0-3]\dT[012]\d:[0-6]\d:[0-6]\d(?:\.\d{1,3})?Z \[WARNING\] Your app's responsiveness.*""" + ) + } } } () diff --git a/tests/jvm/src/test/scala/cats/effect/unsafe/WorkerThreadNameSpec.scala b/tests/jvm/src/test/scala/cats/effect/unsafe/WorkerThreadNameSpec.scala index 5817d10e34..b2be8ec719 100644 --- a/tests/jvm/src/test/scala/cats/effect/unsafe/WorkerThreadNameSpec.scala +++ b/tests/jvm/src/test/scala/cats/effect/unsafe/WorkerThreadNameSpec.scala @@ -16,9 +16,8 @@ package cats.effect.unsafe -import cats.effect.{BaseSpec, IO} +import cats.effect.{BaseSpec /*, IO*/} import cats.effect.testkit.TestInstances -import cats.syntax.all._ import scala.concurrent.duration._ @@ -55,7 +54,9 @@ class WorkerThreadNameSpec extends BaseSpec with TestInstances { } "WorkerThread" should { - "rename itself when entering and exiting blocking region" in real { + "rename itself when entering and exiting blocking region" in skipped( + "this test is quite flaky in CI" + ) /*real { for { _ <- IO.cede computeThread <- threadInfo @@ -91,10 +92,10 @@ class WorkerThreadNameSpec extends BaseSpec with TestInstances { resetBlockerThread must beSome((_: String).endsWith("-0")) .setMessage("blocker thread index was not correct") } - } + }*/ } - private val threadInfo = - IO((Thread.currentThread().getName(), Thread.currentThread().getId())) + /*private val threadInfo = + IO((Thread.currentThread().getName(), Thread.currentThread().getId()))*/ }