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

IOAppSuite failure on JDK 25

Open SethTisue opened this issue 4 months ago • 2 comments

as seen in the Scala 2.13 community build at https://scala-ci.typesafe.com/job/scala-2.13.x-jdk25-integrate-community-build/9/artifact/logs/cats-effect-build.log :

[cats-effect] [error] ==> X cats.effect.IOAppSuite.support main thread evaluation  0.422s munit.ComparisonFailException: ioapp-tests/src/test/scala/IOAppSuite.scala:361
[cats-effect] [error] 360:        val h = platform("EvalOnMainThread", List.empty)
[cats-effect] [error] 361:        assertEquals(h.awaitStatus(), 0)
[cats-effect] [error] 362:      }
[cats-effect] [error] values are not the same
[cats-effect] [error] => Obtained
[cats-effect] [error] 1
[cats-effect] [error] => Diff (- expected, + obtained)
[cats-effect] [error] -0
[cats-effect] [error] +1
[cats-effect] [error]     at munit.FunSuite.assertEquals(FunSuite.scala:13)
[cats-effect] [error]     at cats.effect.IOAppSuite.$anonfun$new$91(IOAppSuite.scala:361)

I assume it's easily reproducible, but if not, lmk

SethTisue avatar Aug 17 '25 16:08 SethTisue

Anyone wanna take odds that the problem is main thread detection?

djspiewak avatar Aug 17 '25 17:08 djspiewak

docker run --rm openjdk:25-oracle bash -c 'echo "public class Main { public static void main(String[] args) { Thread t = Thread.currentThread(); System.out.println(\"ID: \" + t.getId()); System.out.println(\"Name: \" + t.getName()); System.out.println(\"Thread Group: \" + t.getThreadGroup().getName()); System.out.println(\"Parent Thread Group: \" + (t.getThreadGroup().getParent() != null ? t.getThreadGroup().getParent().getName() : \"None\")); } }" > Main.java && javac Main.java && java Main'

The output:

ID: 3
Name: main
Thread Group: main

Name and thread group seem to be aligned with previous versions: https://github.com/typelevel/cats-effect/issues/4306#issuecomment-2897441386.

iRevive avatar Aug 18 '25 11:08 iRevive