Coroutine "threads" in Tomee server?



If I run this simple code in a JUnit test:

runBlocking {

I can see that a lightweight thread is being used:
16:01:53.455 [ForkJoinPool.commonPool-worker-9 @coroutine#2] WARN MyClass - hello

However, exactly the same code run in a WAR file in a Tomee server:

16:01:09.030 [ForkJoinPool.commonPool-worker-9] WARN MyClass - hello

Is there is something I am missing? How can I know whether coroutine “threads” are used or not?

(logback configuration for both):

    <configuration debug="false" reload="true">
        <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
                <pattern>%d{HH:mm:ss.SSS} [%thread] %X{travelc.userId} %X{travelc.websessionid} %-5level %logger{50} - %msg%n</pattern>
        <root level="warn">
            <appender-ref ref="STDOUT" />


@coroutine#2 is added to the thread name when either kotlinx.coroutines.debug system property is set or assertions are enabled. You can read more here:


Thanks, didn’t know that.