From e60439f1668e9cdf315027baf31ca274c8726296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Madsen?= Date: Wed, 8 Mar 2023 11:19:29 +0100 Subject: [PATCH] Allow that the renamed blocker thread is terminated --- .../cats/effect/unsafe/WorkerThreadNameSpec.scala | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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 26418aee11..28fd456de3 100644 --- a/tests/jvm/src/test/scala/cats/effect/unsafe/WorkerThreadNameSpec.scala +++ b/tests/jvm/src/test/scala/cats/effect/unsafe/WorkerThreadNameSpec.scala @@ -67,14 +67,13 @@ class WorkerThreadNameSpec extends BaseSpec with TestInstances { computeThreadName must startWith("io-compute") // Check that entering a blocking region changes the name blockerThreadName must startWith("io-blocker") - // Check that the same thread is renamed again when it is readded to the compute pool - val resetBlockerThread = resetComputeThreads.collectFirst { - case (name, `blockerThreadId`) => name + // Check that the same thread is renamed again if it is readded to the compute pool + resetComputeThreads.map { + case (name, `blockerThreadId`) => { + name must startWith("io-compute").setMessage("blocker thread name was not reset") + } + case _ => ok } - resetBlockerThread must beSome[String].setMessage( - "blocker thread not found after reset") - resetBlockerThread must beSome((_: String).startsWith("io-compute")) - .setMessage("blocker thread name was not reset") } } }