1

I have replaced old io.kotlintest with new io.kotest dependency and imported it to all the tests. They pass when are run individually, but gradle task gradlew test freezes on testDebugUnitTest task.

> Task :myAppModule:testDebugUnitTest
Gradle Test Executor 1 -> ~~~ Kotest Configuration ~~~

Gradle Test Executor 1 -> -> Parallelism: 1 thread(s)

Gradle Test Executor 1 -> -> Default test timeout: 600000ms

Gradle Test Executor 1 -> -> Default test order: TestCaseOrder

Gradle Test Executor 1 -> -> Default isolation mode: IsolationMode

Gradle Test Executor 1 -> -> Global soft assertations: False

Gradle Test Executor 1 -> -> Write spec failure file: False

Gradle Test Executor 1 -> -> Fail on ignored tests: False

Gradle Test Executor 1 -> -> Spec execution order:     LexicographicSpecExecutionOrder

Gradle Test Executor 1 -> -> Extensions

Gradle Test Executor 1 ->   - io.kotest.core.extensions.SystemPropertyTagExtension

Gradle Test Executor 1 ->   - io.kotest.core.extensions.RuntimeTagExtension

Gradle Test Executor 1 -> 

If I run test gradle task in debug mode the code stops on MessageHub class in Gradle (v5.4.1) library. So it looks like multithreading issue (because the test runs only on one thread).

I have created cutsom ProjectComfig object:

package io.kotest.provided

import io.kotest.core.config.AbstractProjectConfig

object ProjectConfig : AbstractProjectConfig() {

    private var started: Long = 0

    override fun beforeAll() {
        started = System.currentTimeMillis()
    }

    override fun afterAll() {
        val time = System.currentTimeMillis() - started
        println("overall time [ms]: $time")
    }

    override val parallelism: Int = 4
 }

But the gradle task still runs with 1 thread. I have added this package in the module /src/test/kotlin/io/kotest/provided directory.

P.S. I cannot use or create kotest tag because I do not have 1500 reputation. :-(

Mikezx6r
  • 16,829
  • 7
  • 33
  • 31
Angelina
  • 11
  • 3
  • 1
    Hi, Angelina! I'm one of the developers for Kotest. We are tracking this bug from now on, and have discovered that it only happens for gradle 5.X, and thus if you use the latest gradle (6.2 at the moment) it will work correctly. – LeoColman Mar 01 '20 at 00:04
  • We're still investigating what happened to our execution and integration with gradle. – LeoColman Mar 01 '20 at 00:04
  • If you're using gradle < 6, set a system property called kotest.gradle5.compatibility=true and make sure you're using 4.0.2. This is a workaround for a bug in gradle 5.x – sksamuel Apr 04 '20 at 04:34

0 Answers0