ollis · GitHub

kotest : 5.4.0
kotlin: 1.6.21
ktor: 2.0.3

kotest hangs when I use nested spec styles in conjunction with ktor
Minimal example:

package no.norsktipping.customerservice.customersupportontactinformation
import io.kotest.assertions.ktor.client.shouldHaveStatus
import io.kotest.core.spec.style.FreeSpec
import io.ktor.client.request.*
import io.ktor.server.config.*
import io.ktor.server.testing.*
class FreeSpecTest : FreeSpec({
    "outer" - {
        "inner 1" {
            println("inner 1!")
        }
        testApplication {
            environment {
                config = MapApplicationConfig()
            }
            println("testApplication start")
            val notfound = client.get("/notfound")
            notfound shouldHaveStatus 404
            println("assert complete")
//            "inner 2" {
//                println("inner 2!")
//            }
            println("testApplication end")
        }
    }
})

This gives the following (expected) output:

inner 1!
testApplication start
2022-08-01 12:04:48.499  INFO          --- [atcher-worker-1] ktor.test                                : Application started in 0.175 seconds.
assert complete
testApplication end

But it hangs if I uncomment the "inner 2" block and the output changes to this:

inner 1!

Read the original on github.com ↗