4.4.0.RC1 is being released. Would welcome any fee...
# kotest
s
4.4.0.RC1 is being released. Would welcome any feedback and bug reports
👌 1
k
After upgrading to that version our tests stopped executing We use Maven + kotest-runner-junit5-jvm The error doesn't contain any details unfortunately
Copy code
<testcase name="Kotest" classname="Kotest" time="0">
    <error type="java.lang.NoClassDefFoundError"><![CDATA[java.lang.NoClassDefFoundError: Could not initialize class SomeOurClass
]]></error>
  </testcase>
Any idea how to debug this? The only change I made is to bump version number for: • kotest-assertions-core-jvm • kotest-assertions-arrow-jvm • kotest-property-jvm • kotest-property-arrow-jvm • kotest-extensions-spring-jvm
s
Does some class have a static initializer? (companion objects?)
k
yes
s
It's probably doing something that is causing the class to fail
k
how can I get a stack trace?
s
not sure
kotest should be grabbing the class failure
k
let me try removing this test and see which others fail, maybe there is something common between them
s
ok
Copy code
NoClassDefFoundError
founds are tricky because its the classloader doing it
k
I removed two tests which were failing with `NoClassDefFoundError`and for the remaining tests I got empty result:
Copy code
~~~ Kotest Configuration ~~~
-> Parallelization factor: 11
-> Concurrent specs: null
-> Global concurrent tests: 1
-> Dispatcher affinity: true
-> Default test timeout: 600000ms
-> Default test order: Random
-> Default isolation mode: InstancePerLeaf
-> Global soft assertions: false
-> Write spec failure file: false
-> Fail on ignored tests: false
-> Spec execution order: SpecExecutionOrder
-> Include test scope affixes: true
-> Remove test name whitespace: false
-> Append tags to test names: false
-> Extensions
  - io.kotest.spring.SpringAutowireConstructorExtension
  - io.kotest.engine.extensions.SystemPropertyTagExtension
  - io.kotest.core.extensions.RuntimeTagExtension
  - io.kotest.engine.extensions.RuntimeTagExpressionExtension
-> Listeners
  - io.atlassian.authentication.TestPrinterListener
  - io.atlassian.authentication.MockkResetListener
  - class io.kotest.engine.config.LoadConfigFromClasspathKt$toDetectedConfig$beforeAfterAllListener$1

~~~ Running tests in Development mode ~~~
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
I call it a progress 😄
s
lol
are you running from intellij or gradle
k
mvn
it works fine from IntelliJ
s
interesting
Copy code
Parallelization factor: 11
k
at least for individual tests
s
set that to 1
see if that fixes it
k
yes sir!
😁 1
Copy code
~~~ Kotest Configuration ~~~
-> Parallelization factor: 1
-> Concurrent specs: null
-> Global concurrent tests: 1
-> Dispatcher affinity: true
-> Default test timeout: 600000ms
-> Default test order: Random
-> Default isolation mode: InstancePerLeaf
-> Global soft assertions: false
-> Write spec failure file: false
-> Fail on ignored tests: false
-> Spec execution order: SpecExecutionOrder
-> Include test scope affixes: true
-> Remove test name whitespace: false
-> Append tags to test names: false
-> Extensions
  - io.kotest.spring.SpringAutowireConstructorExtension
  - io.kotest.engine.extensions.SystemPropertyTagExtension
  - io.kotest.core.extensions.RuntimeTagExtension
  - io.kotest.engine.extensions.RuntimeTagExpressionExtension
-> Listeners
  - io.atlassian.authentication.TestPrinterListener
  - io.atlassian.authentication.MockkResetListener
  - class io.kotest.engine.config.LoadConfigFromClasspathKt$toDetectedConfig$beforeAfterAllListener$1

~~~ Running tests in Development mode ~~~
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
😿
s
Ok that's good actually
I didn't want it to be the concurrency stuff
Next thing to try - can you add a env var KOTEST_DEBUG=true
that should give you a ton of logs
k
very lightweight this ton
Copy code
uniqueId=[engine:kotest]
LauncherDiscoveryRequest [
configurationParameters=LauncherConfigurationParameters []
classpathRootSelectors=[]
classpathResourceSelectors=[]
classSelectors=[io.atlassian.authentication.SpringIntegrationTest]
methodSelectors=[]
directorySelectors=[]
fileSelectors=[]
moduleSelectors=[]
packageSelectors=[]
uniqueIdSelectors=[]
uriSelectors=[]
engineFilters=[]
postDiscoveryFilters=[]
classnameFilters=[]
packageNameFilters=[]
]
Discovery: Loading specified classes...
Discovery: Loading of selected classes completed in 7ms
After filters there are 0 spec classes
After discovery extensions there are 0 spec classes
Discovery result [0 specs; 0 scripts]
uniqueId=[engine:kotest]
LauncherDiscoveryRequest [
configurationParameters=LauncherConfigurationParameters []
classpathRootSelectors=[]
classpathResourceSelectors=[]
classSelectors=[io.atlassian.authentication.SpringIntegrationTest]
methodSelectors=[]
directorySelectors=[]
fileSelectors=[]
moduleSelectors=[]
packageSelectors=[]
uniqueIdSelectors=[]
uriSelectors=[]
engineFilters=[]
postDiscoveryFilters=[]
classnameFilters=[]
packageNameFilters=[]
]
Discovery: Loading specified classes...
Discovery: Loading of selected classes completed in 0ms
After filters there are 0 spec classes
After discovery extensions there are 0 spec classes
Discovery result [0 specs; 0 scripts]
JUnit ExecutionRequest[org.junit.platform.engine.ExecutionRequest] [configurationParameters=LauncherConfigurationParameters []; rootTestDescriptor=KotestEngineDescriptor: [engine:kotest]]
I assume no tests were actually found
s
Copy code
classSelectors=[io.atlassian.authentication.SpringIntegrationTest]
its looking for that test only
k
oh no
s
you've set it to run that test somehow
k
it will not find any in unit tests
s
I guess that was a mistake ?
k
where this might be configured?
s
Copy code
classSelectors
are passed into the junit runner by the build. So from your mvn somewhre.
k
I copied wrong logs damn it
s
🙂
k
sorry about that
s
np
k
ok there is ton of logs indeed 😄
Copy code
Discovery: Loading specified classes...
Discovery: Loading of selected classes completed in 1ms
After filters there are 71 spec classes
After discovery extensions there are 71 spec classes
Discovery result [71 specs; 0 scripts]
JUnit ExecutionRequest[org.junit.platform.engine.ExecutionRequest] [configurationParameters=LauncherConfigurationParameters []; rootTestDescriptor=KotestEngineDescriptor: [engine:kotest]]
so it looks the specs were found
s
ok
k
Copy code
~~~ Running tests in Development mode ~~~
KotestEngine: Beginning test plan [specs=71, scripts=0, parallelism=11}]
KotestEngine: Launching 0 scripts
invokeAfterProject
Engine finished; throwables=[]
Notifying junit that root descriptor completed KotestEngineDescriptor: [engine:kotest]
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
s
Copy code
Running tests in Development mode
that's your thing ?
k
Copy code
Launching 0 scripts
s
yeah scripts not important that's a new thing
k
not sure, lemme check
yeah, just beforeAll on AbstractProjectConfig
s
Copy code
KotestEngine: Beginning test plan [specs=71, scripts=0, parallelism=11}]
KotestEngine: Launching 0 scripts
invokeAfterProject
Engine finished; throwables=[]
Notifying junit that root descriptor completed KotestEngineDescriptor: [engine:kotest]
there's nothing in between those lines ?
k
no
that's it
s
Copy code
// spec classes are ordered using an instance of SpecExecutionOrder
val ordered = plan.classes.sort(configuration.specExecutionOrder)
val executor = SpecExecutor(config.listener)

val launcher = specLauncher()
so something in there is crashing it
k
which class is that? I might set debugger
s
KotestEngine
k
cheers
I will play with this later afternoon, meetings...
thanks Sam!
s
alright I'll be in bed
but ping me in here I'll respond tomorrow
k
I'll post what I found
👍🏻 1
java.lang.NoClassDefFoundError: kotlin/KotlinNothingValueException
during
Copy code
stackTrace = {StackTraceElement[44]@4382} 
 0 = {StackTraceElement@4384} "kotlinx.coroutines.sync.SemaphoreImpl.<init>(Semaphore.kt:137)"
 1 = {StackTraceElement@4385} "kotlinx.coroutines.sync.SemaphoreKt.Semaphore(Semaphore.kt:71)"
 2 = {StackTraceElement@4386} "kotlinx.coroutines.sync.SemaphoreKt.Semaphore$default(Semaphore.kt:71)"
 3 = {StackTraceElement@4387} "io.kotest.engine.launchers.DefaultSpecLauncher.<init>(DefaultSpecLauncher.kt:31)"
 4 = {StackTraceElement@4388} "io.kotest.engine.launchers.SpecLauncherKt$specLauncher$2.invoke(SpecLauncher.kt:36)"
 5 = {StackTraceElement@4389} "io.kotest.engine.launchers.SpecLauncherKt$specLauncher$2.invoke(SpecLauncher.kt)"
 6 = {StackTraceElement@4390} "io.kotest.fp.OptionKt.getOrElse(Option.kt:34)"
 7 = {StackTraceElement@4391} "io.kotest.engine.launchers.SpecLauncherKt.specLauncher(SpecLauncher.kt:35)"
 8 = {StackTraceElement@4392} "io.kotest.engine.KotestEngine.submitAll(KotestEngine.kt:132)"
 9 = {StackTraceElement@4393} "io.kotest.engine.KotestEngine.execute(KotestEngine.kt:80)"
we use Kotlin 1.3.72
does 4.4.0+ require Kotlin 1.4+?
looks like it does as it depends Maven-wise on kotlin-stdlib-jdk8 1.4.21
s
I can probably make it 1.3 compatible. We only use a couple of things
k
We will switch to 1.4 eventually but there is some issue with Jackson AFAIR. My view - go ahead we will catch up eventually.
s
alright
I use jackson on 1.4 btw at work
🙏 1
k
2.9.8+ Releases are compiled with Kotlin 1.3.x
🤷
s
compiled with 1.3 doesn't mean you can't use it on 1.4
My entire project at work is 1.4.21 and that uses jackson (2.10.x) everywhere (json kafka messages)
k
thanks, maybe we just assume the issues we have are caused by Jackson but it actually is something else
from the other hand might be easier to wait and rule out the obvious
s
Jackson is always a bit of a bitch when upgrading versions
it's (in the past at least) been quite cavalier about breaking things internally
k
same feelings on our side, that's one of the reasons we want to be rather extra careful with this
s
fair enough