https://kotlinlang.org logo
Title
s

Sourabh Rawat

03/03/2022, 8:58 AM
Blockhound's
allowBlockingCallsInside
does not work if I don't run the test in debug mode? I am thinking its a stack trace recovery issue during normal tests? I tried following to replicate courotines debug mode during normal test runs
tasks.withType<Test> {
    useJUnitPlatform()
    jvmArgs = listOf("-XX:+AllowRedefinitionToAddDeleteMethods", "-ea", "-Dkotlinx.coroutines.debug=on", "-Dkotlinx.coroutines.stacktrace.recovery=true")
}
but it didnt work Any help is apprecitated!
d

Dmitry Khalanskiy [JB]

03/09/2022, 7:45 AM
The BlockHound integration is provided in the
kotlinx-coroutines-debug
artifact. I don't think it's necessary to run tests in the debug mode, but you do need to list
kotlinx-coroutines-debug
as a dependency.