:wave: hello! I have an issue with beta1 kotest ve...
# kotest
a
πŸ‘‹ hello! I have an issue with beta1 kotest version in πŸ€– . if i run
gradlew test
it freezes πŸ™„ anyone else experienced this issue? I have default config (1 thread). I tried to add custom config but kotest did not pick it up πŸ€·β€β™€οΈ
l
Hi, @Angelina!I did experience that, yes. While I was debugging, I couldn't reproduce it again. What I believe worked was making sure all gradle daemons are dead, and then updating to gradle 6.2
We are investigating what is happening to older gradles, but so far we couldn't reproduce the issue very much
s
It would be good to know which version of gradle and kotlin you are using
a
I was trying to migrate kotlintest micronaut extension to kotest and faced the same problem. Gradle version 5.6.2 KotlinVersion = 1.3.61 code url: https://github.com/ashishkujoy/micronaut-test
While running test on debug mode find out following error
Copy code
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
l
Ashish, could you try to see if gradle 6.2 (the latest version) has that issue?
s
Do you have the full stack trace. There's probably a real error lurking inside that proxy exception @Ashish Kumar Joy
a
@sam
s
Interesting. Failed getting annotations
Which jvm gradle and kotlin and os
a
Gradle version 5.6.2 KotlinVersion = 1.3.61 os = mac os 10.14.6
s
And jvm
a
java version β€œ1.8.0_241” Java(TM) SE Runtime Environment (build 1.8.0_241-b07) Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)
s
All looks fine. We can fix this by catching the exception when we look up annotations but out of interest try changing your gradle wrapper to 6.1.1 see if it goes away
a
As suggest by @LeoColman i tried with gradle 6.2 and there test were running.
s
Ok so it is a gradle thing
I'll add a workaround try catch
a
Thanks for all the answers,
Copy code
const val gradle = "5.6.4"
const val gradleBuildTools = "3.5.3"
i will try to run with gradle 6.2
with gradle 6.2 it works fine! but in android we usually use default gradle wrapper, which is few versions lower than the latest gradle version πŸ€”
s
We're going to fix for gradle 5.x
πŸ€– 1
πŸ‘ 1
a
Copy code
tasks.withType<Wrapper> {
    gradleVersion = "6.2"
}
this does not work, still uses ols gradle version
btw where should i put the ProjectConfig object? I tried
module/src/test/kotlin/io/kotest/provided
but it is not used πŸ€” it would be so nice to use more threads. i tried to put this package in all possible locations with no result..
s
In 4.0.0 just create an instance anywhere and it will be picked up
it must extend AbstractProjectConfig
a
i did, it is not picked up 😞 i even tried to add
io.kotest.core
dependency, but it did not help πŸ€·β€β™€οΈ
a
yes, i copy pasted it
s
How do you know it's not working, what setting are you trying to modify with it
a
Copy code
import io.kotest.core.config.AbstractProjectConfig

object ProjectConfig : AbstractProjectConfig() {

    override val parallelism: Int = 4
}
i added listener, and i see the dump output
beforeSuite Gradle Test Run logviewertestDebugUnitTest beforeSuite Gradle Test Executor 1 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 ->
s
ok, try changing something like in there setting default test case order
in case it's a bug with the parallelism setting
a
Copy code
val testCaseOrder
is final and cannot be overriden, i changed timeout to ZERO and it worked... so you're right smth is worng with parallerism
s
I'm looking at parallel now
is final and cannot be overriden <--- good spot, fixing that too
πŸ‘ 1
βœ”οΈ 1
~ Kotest Configuration ~ -> Parallelism: 10 thread(s) -> Default test timeout: 600000ms -> Default test order: TestCaseOrder -> Default isolation mode: IsolationMode -> Global soft assertations: False -> Write spec failure file: False -> Fail on ignored tests: False -> Spec execution order: LexicographicSpecExecutionOrder -> Extensions - io.kotest.core.extensions.SystemPropertyTagExtension - io.kotest.core.extensions.RuntimeTagExtension
That looks better
So parallelism was broken, and also the test for it was passing because the afterAll method in project conf was broken so the assertion never fired
so that's 3 bugs fixed in one, thank you for finding these
All fixed in master, will be included in the next beta release (2 days)
a
awesome! Thank you so much! I am looking forward to the next release! ❀️ πŸ€– K Another minor thing: in your Kotest page you say we should use
kotest
tag in stackoverflow but it has not been created yet and one should have at least 1500 reputation to create a new tag in stackoverflow
m
I removed kotlintest tag from this question and added kotest (SO only allows 5). So kotest tag now exists. https://stackoverflow.com/questions/60351366/kotest-freezes-after-migrating-to-4-0-0-beta1-on-testdebugunittest-task
I have updated the info on the tag, but not quite enough rep to have it immediately visible. Needs peer review
a
awesome, you are the best team!
m
They are awesome! I'm a fellow user, but happy to help out where I can.
And your Gradle question. Changing the version in the Wrapper task will only impact if you run the wrapper task. You can either change the version from the CLI, or manually edit the gradle-wrapper.properties file in the gradlew\wrapper folder of your project. https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper
s
@Mike is our favourite user πŸ˜‰
❀️ 1
m
😊
a
thanks a lot @Mike ❀️ πŸ€– !