https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kotest
  • w

    WukongRework.exe

    08/18/2020, 6:04 AM
    Hi, i’ve just updated my kotlin version to 1.4.0, i updated the intellij plugin i updated my gradle build script all of that stuff. i went to run my tests and it says it fails in <init> saying
    Could not initialize class io.kotest.core.test.TestResult
    s
    i
    s
    • 4
    • 37
  • h

    huehnerlady

    08/18/2020, 7:51 AM
    Hi, I found this message looking for an answer but unfortunately it did not get an answer. I am new to kotest and now run into the problem that I would like to display my own message when there is an error. My example is
    null shouldNotBe null
    in this case I get a generic message
    <null> should not equal <null>
    This is not very helpful. I would get an error I write myself, e.g. “Property ‘test’ is null, although it shouldn’t have been”. I understand that the matcher does not know this, but as I know which item I added in there I could make the error message clearer. How can I achieve this?
    ☑️ 1
    s
    • 2
    • 2
  • h

    huehnerlady

    08/19/2020, 9:19 AM
    I use Kotest with FreeSpec. I really like it, but wverytime a test fails it is marked as 2 failures. What can I do to prevent this? I have a class:
    import io.kotest.core.spec.IsolationMode
    import io.kotest.core.spec.style.FreeSpec
    import io.kotest.matchers.shouldBe
    
    internal class Test : FreeSpec() {
    
      override fun isolationMode(): IsolationMode = IsolationMode.InstancePerTest
    
      init {
        beforeTest {
          print("beforeTest")
        }
    
        "fails" - {
          true shouldBe false
        }
    
        "passes" - {
          true shouldBe true
        }
      }
    }
    the result looks in intellij like screenshot 1 and in gradle I get the error “2 failed” with the tests visible in screenshot 2. How can I get rid of the
    init
    in intellij and the
    Test.executionError
    in gradle? Is it the Spec I am using or something wrong with kotest? I am using kotlin 1.3.72 and kotest 4.1.3
    ☑️ 1
    p
    s
    • 3
    • 19
  • l

    LeoColman

    08/19/2020, 5:24 PM
    @elect I think you'll need to upgrade Kotest's plugin to use the new RC
    e
    • 2
    • 2
  • s

    sam

    08/19/2020, 10:59 PM
    4.2.0.RC3 has been released, this is the one to try if you're using kotlin 1.4
    e
    • 2
    • 35
  • r

    Rob Elliot

    08/20/2020, 9:41 AM
    Has anything changed around the Tags / ProjectConfig discovery? It looks like I’ve got a regression, where either the config isn’t being picked up or the tag isn’t being applied, and a test I was expecting to be skipped is being run. Haven’t explored very far yet; not even sure whether it’s a 4.0, 4.1 or 4.2 that it changed in.
    s
    • 2
    • 26
  • s

    Skolson5903

    08/23/2020, 10:41 AM
    I have a multiplatform project that had android and ios targets, and I just added jvm(). So now there are two new sourcesets; jvmMain and jvmTest. I'm trying to debug new JVM unit tests in jvmTest (based on StringSpec), but the debugger fails with a ClassNotFoundException on the test class. I dug through the classpath entries, and the applicable ones listed for the build are:
    build\intermediates\java_res\debugUnitTest\out;
        build\tmp\kotlin-classes\debugUnitTest;
        build\intermediates\java_res\debug\out;
        build\tmp\kotlin-classes\debug;
    None of these directories have the jvmTest classes in them after running gradle task jvmTestClasses. I dug around, and the unit tests all compiled to here:
    build\classes\kotlin\jvm\test
    What controls which directories get put in the classpath from the gradle build when doing a run or debug? Is this a Kotest plugin thing, or do I have something wrong in my gradle setup? Thanks in advance for any help. BTW this is AndroidStudio and I'm currently running the snapshot plugin 1.1.0-SNAPSHOT-IC-2019.3
    s
    • 2
    • 26
  • t

    thanksforallthefish

    08/26/2020, 8:02 AM
    I am getting
    09:58:23.088 [main] DEBUG org.testcontainers.utility.TestcontainersConfiguration - Testcontainers configuration overrides will be loaded from file:/Users/marco/.testcontainers.properties
    ~~~ Kotest Configuration ~~~
    -> Parallelization factor: 1
    -> Default test timeout: 600000ms
    -> Default test order: Sequential
    -> Default isolation mode: SingleInstance
    -> Global soft assertations: False
    -> Write spec failure file: False
    -> Fail on ignored tests: False
    -> Spec execution order: SpecExecutionOrder
    -> Extensions
      - io.kotest.spring.SpringAutowireConstructorExtension
      - io.kotest.engine.extensions.SystemPropertyTagExtension
      - io.kotest.core.extensions.RuntimeTagExtension
      - io.kotest.engine.extensions.RuntimeTagExpressionExtension
      - io.kotest.engine.extensions.SpecifiedTagsTagExtension
    -> Listeners
      - io.kotest.provided.PostgresListener
      - io.kotest.spring.SpringListener
      - class io.kotest.provided.ProjectConfig$listeners$1
      - class io.kotest.engine.config.LoadConfigFromClasspathKt$toDetectedConfig$beforeAfterAllListener$1
    
    
    Process finished with exit code 0
    on some tests, while others run correctly. is there something I can do to increase verbose(ness) and understand what is going on? I upgraded the kotlin plugin (the jetbrains one) to 1.4, but still run on kotlin 1.3. I already even tried to upgrade to kotlin 1.4 and kotest 4.2.0 but still getting this weird behavior. I am using latest kotest plugin, 1.16
    s
    • 2
    • 8
  • s

    Skolson5903

    08/27/2020, 6:29 PM
    I have several of Kotests in a 1.4.0 multi-platform project's jvmTest that used to work. I've changed a number of things so don't know what triggered this, but now they are all failing with the call stack below. Interestingly I think the tests are all running correctly before hitting this exception, because tests with println(..) calls in them are showing correctly on the console before this error hits. And if I introduce a failing shouldBe, I see that error like normal. So it's as if this is happening after each test is complete. All the test classes are StringSpec-based. Anyone else seen this? I'm using Kotlin 1.4.0, JUnit5 and Kotest 4.2.2 (also happens on 4.2.0). Also OpenJDK 14.0.2, but error also happens on JDK8 embedded with Android Studio, so I don't think it's a JDK thing.
    java.lang.IllegalArgumentException: wrong number of arguments
       at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
       at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
       at io.kotest.engine.InstantiateSpecKt.javaReflectNewInstance(instantiateSpec.kt:23)
       at io.kotest.engine.InstantiateSpecKt.instantiateSpec(instantiateSpec.kt:17)
       at io.kotest.engine.spec.SpecExecutor.createInstance(SpecExecutor.kt:101)
       at io.kotest.engine.spec.SpecExecutor.execute(SpecExecutor.kt:41)
       at io.kotest.engine.KotestEngine$submitBatch$$inlined$forEach$lambda$1$1.invokeSuspend(KotestEngine.kt:139)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
       at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
       at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
       at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
       at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
       at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
       at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
       at io.kotest.engine.KotestEngine$submitBatch$$inlined$forEach$lambda$1.run(KotestEngine.kt:138)
       at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
       at java.base/java.lang.Thread.run(Thread.java:832)
    s
    • 2
    • 9
  • j

    Joel Hess

    08/27/2020, 7:38 PM
    I’m running a kotest 4.2 on a Spring boot Integration Test (with a
    SpringBootTest
    annotation) and using
    eventually
    to wait for a result, but it appears to not be waiting for the whole time.
    eventually(60.seconds) {
        val member = memberProjectionRepository.findByTenantIdAndClientMemberId(
           createMemberCmd.tenantId,
           clientMemberId
        )
        println("ack")
        member.shouldNotBeNull()
        member.clientMemberId.shouldBe(clientMemberId)
    }
    I see my
    ack
    in the output once or twice, but that’s it. any other tests that I have in the spec still continue to run as expected. How can I keep it from shutting down prematurely?
    s
    • 2
    • 8
  • t

    tim

    08/27/2020, 10:24 PM
    Hi all, i'm running into an issue when running my test suite via the cli ( ie `gradle 😛roject:test``). If I run tests via the kotest idea extension everything passes no issues, but when i try running the same tests via the cli i'm getting the stacktrace provided as a reply to this message (headline is
    com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Strange Map type java.util.Map: cannot determine type parameters
    ) I'm at a loss and not sure what to try next so all suggestions welcome!! 😞 Also the error isn't occuring in just one area its on quiet a few tests.
    s
    h
    • 3
    • 39
  • t

    Tamas Balogh

    08/28/2020, 2:27 PM
    We are evaluating the usage
    kotest-extensions-robolectric
    , which looks like is not compatible with
    4.2.2
    As I see all Android related things are extracted to https://github.com/kotest/kotest-android, but that one has no release yet. What are the plans for that release?
    s
    l
    • 3
    • 8
  • a

    atara

    08/29/2020, 7:41 AM
    @sam I am trying to upgrade to latest version of kotest but found that version 4.2.2 is not available for all the dependencies, for example
    kotest-runner-console-jvm
    . What will be your recommendation? Should we use 4.1.3 for all the kotest repositories ? Currently we use 4.1.0 for all of them. Thank you
    m
    s
    • 3
    • 13
  • t

    thanksforallthefish

    08/31/2020, 7:34 AM
    hello, sorry to bother again, how would you handle Intellij importing the wrong dependency? I try to be concise, but this might get long. I created a sample project to show the issue: https://github.com/ThanksForAllTheFish/classgraph here it goes (and please, let me know if I get anything wrong): • kotest framework engine 4.2 relies on classpagraph 4.8.89, but declares the dependency as
    implementation
    therefore gradle does not add the dependency to the compile classpath, due the java library plugin: https://github.com/kotest/kotest/blob/master/kotest-framework/kotest-framework-discovery/build.gradle.kts • springdoc ui is maven project, so not that sophisticated, and relies on webjars, which in turns relies on classgraph 4.8.69: https://github.com/webjars/webjars-locator-core/blob/master/pom.xml#L57 • in between those 2 releases of classgraph, a new method
    rejectPackages
    was added and is used by kotest, for instance https://github.com/kotest/kotest/blob/master/kotest-framework/kotest-framework-engine/src/jvmMain/kotlin/io/kotest/engine/config/detectConfig.kt#L28 • because in kotest the dependency is at runtime only, idea does not see and when running a test from the ide it fails due to a method not found exception and crashes the testframework it was quite hard to debug, the failure can be seen with a breakpoint https://github.com/kotest/kotest/blob/master/kotest-framework/kotest-framework-engine/src/jvmMain/kotlin/io/kotest/engine/launcher/execute.kt#L84 but it is not logged anywhere I could find see pictures, no dep for kotest, 4.8.69 for springdoc in the first one, the error in the second
    l
    s
    • 3
    • 23
  • m

    mitch

    08/31/2020, 9:40 AM
    @sam hey hey I finally got into this slack! thanks for answering my q on https://github.com/kotest/kotest/issues/1646 I'm currently prepping a PR for that (including introducing the new
    value(rs: RandomSource): Sample<A>
    ). now alot of the code is currently using values (it shows the strikethrough in intellij) and I'm fixing those as well. I realized that there's a fair few functions like this one
    arb(...)
    that wants Sequence in it, how would I go about that?
    s
    • 2
    • 92
  • h

    huehnerlady

    09/01/2020, 9:14 AM
    I run into the same issue as this Issue with the kotest plugin. I just face this issue in one of my 2 projects. Did someone else have this issue and found a workaround?
    ☑️ 1
    s
    • 2
    • 10
  • w

    WukongRework.exe

    09/02/2020, 6:16 AM
    i ran into this issue where a class im testing is said to override a final method remove, however this class specifically does not override remove, its parent class of Vector does. So I reran my Vector Test class and this error did not occur. the type hierarchy is: IntVector (Class) -> NumberVector<Int> (Abstract Class) -> Vector<Int> (Class) -> VectorBase<Int> (Interface) currently running kotest v4.2.0 with plugin version 1.1.16-IC-2020.1
    • 1
    • 1
  • w

    WukongRework.exe

    09/02/2020, 6:16 AM
    class org.kotrix.vector.IntVector overrides final method remove.(Ljava/lang/Object;)Z
    java.lang.VerifyError: class org.kotrix.vector.IntVector overrides final method remove.(Ljava/lang/Object;)Z
    	at java.lang.ClassLoader.defineClass1(Native Method)
    	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	at org.kotrix.vector.IntVectorTest$1$1.invokeSuspend(IntVectorTest.kt:12)
    	at org.kotrix.vector.IntVectorTest$1$1.invoke(IntVectorTest.kt)
    	at io.kotest.core.internal.ExecutionsKt$executeWithBehaviours$2$1.invokeSuspend(executions.kt:13)
    	at io.kotest.core.internal.ExecutionsKt$executeWithBehaviours$2$1.invoke(executions.kt)
    	at io.kotest.core.internal.ExecutionsKt.wrapTestWithGlobalAssert(executions.kt:39)
    	at io.kotest.core.internal.ExecutionsKt$executeWithBehaviours$2.invokeSuspend(executions.kt:12)
    	at io.kotest.core.internal.ExecutionsKt$executeWithBehaviours$2.invoke(executions.kt)
    	at io.kotest.core.internal.ExecutionsKt$wrapTestWithAssertionModeCheck$2.invokeSuspend(executions.kt:25)
    	at io.kotest.core.internal.ExecutionsKt$wrapTestWithAssertionModeCheck$2.invoke(executions.kt)
    	at io.kotest.core.internal.AssertionsCheckKt.executeWithAssertionsCheck(assertionsCheck.kt:25)
    	at io.kotest.core.internal.ExecutionsKt.wrapTestWithAssertionModeCheck(executions.kt:24)
    	at io.kotest.core.internal.ExecutionsKt.executeWithBehaviours(executions.kt:11)
    	at io.kotest.core.internal.TestCaseExecutor$executeAndWait$2$1$1$3$1.invokeSuspend(TestCaseExecutor.kt:207)
    	at io.kotest.core.internal.TestCaseExecutor$executeAndWait$2$1$1$3$1.invoke(TestCaseExecutor.kt)
    	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
    	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:194)
    	at io.kotest.core.internal.TestCaseExecutor$executeAndWait$2$1$1$3.invokeSuspend(TestCaseExecutor.kt:201)
    	at io.kotest.core.internal.TestCaseExecutor$executeAndWait$2$1$1$3.invoke(TestCaseExecutor.kt)
    	at io.kotest.mpp.ReplayKt.replay(replay.kt:18)
    	at io.kotest.core.internal.TestCaseExecutor$executeAndWait$2$1$1.invokeSuspend(TestCaseExecutor.kt:196)
    	at io.kotest.core.internal.TestCaseExecutor$executeAndWait$2$1$1.invoke(TestCaseExecutor.kt)
    	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturnIgnoreTimeout(Undispatched.kt:102)
    	at kotlinx.coroutines.TimeoutKt.setupTimeout(Timeout.kt:120)
    	at kotlinx.coroutines.TimeoutKt.withTimeout(Timeout.kt:37)
    	at io.kotest.core.internal.TestCaseExecutor$executeAndWait$2$1.invokeSuspend(TestCaseExecutor.kt:195)
    	at io.kotest.core.internal.TestCaseExecutor$executeAndWait$2$1.invoke(TestCaseExecutor.kt)
    	at io.kotest.engine.ExecutorExecutionContext$executeWithTimeoutInterruption$$inlined$suspendCoroutine$lambda$2.invokeSuspend(ExecutorExecutionContext.kt:46)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
    	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
    	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
    	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    	at io.kotest.engine.ExecutorExecutionContext.executeWithTimeoutInterruption(ExecutorExecutionContext.kt:45)
    	at io.kotest.core.internal.TestCaseExecutor$executeAndWait$2.invokeSuspend(TestCaseExecutor.kt:194)
    	at io.kotest.core.internal.TestCaseExecutor$executeAndWait$2.invoke(TestCaseExecutor.kt)
    	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturnIgnoreTimeout(Undispatched.kt:102)
    	at kotlinx.coroutines.TimeoutKt.setupTimeout(Timeout.kt:120)
    	at kotlinx.coroutines.TimeoutKt.withTimeout(Timeout.kt:37)
    	at io.kotest.core.internal.TestCaseExecutor.executeAndWait(TestCaseExecutor.kt:192)
    	at io.kotest.core.internal.TestCaseExecutor.invokeTestCase(TestCaseExecutor.kt:161)
    	at io.kotest.core.internal.TestCaseExecutor.executeActiveTest(TestCaseExecutor.kt:130)
    	at io.kotest.core.internal.TestCaseExecutor$intercept$2.invokeSuspend(TestCaseExecutor.kt:80)
    	at io.kotest.core.internal.TestCaseExecutor$intercept$2.invoke(TestCaseExecutor.kt)
    	at io.kotest.core.internal.TestCaseExecutor.executeIfActive(TestCaseExecutor.kt:94)
    	at io.kotest.core.internal.TestCaseExecutor.intercept(TestCaseExecutor.kt:80)
    	at io.kotest.core.internal.TestCaseExecutor.execute(TestCaseExecutor.kt:61)
    	at io.kotest.engine.runners.SingleInstanceSpecRunner.runTest(SingleInstanceSpecRunner.kt:73)
    	at io.kotest.engine.runners.SingleInstanceSpecRunner$execute$2$invokeSuspend$$inlined$invoke$lambda$1.invokeSuspend(SingleInstanceSpecRunner.kt:83)
    	at io.kotest.engine.runners.SingleInstanceSpecRunner$execute$2$invokeSuspend$$inlined$invoke$lambda$1.invoke(SingleInstanceSpecRunner.kt)
    	at io.kotest.engine.spec.SpecRunner$runParallel$$inlined$map$lambda$2$1.invokeSuspend(SpecRunner.kt:80)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
    	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
    	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
    	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    	at io.kotest.engine.spec.SpecRunner$runParallel$$inlined$map$lambda$2.run(SpecRunner.kt:79)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    t
    s
    • 3
    • 14
  • s

    snowe

    09/04/2020, 12:30 AM
    i have a generative test case that generates over 7k tests. When run by itself in intellij (just the test class), the test completes in 4 seconds. If instead, I select the directory and run all tests in the whole project, the tests take over 22 minutes to complete. Each consecutive test takes longer than the one before to complete. No clue what is going on here. anyone ever seen this?
    s
    l
    • 3
    • 82
  • s

    snowe

    09/04/2020, 4:54 AM
    On a different note, I am using the kotest pitest plugin. I realize that the kotest plugin is not the cause of this, but I'm wondering if you have a solution to it. I get this error:
    removed call to kotlin/jvm/internal/Intrinsics::checkNotNullExpressionValue → SURVIVED
    in many places. I found this issue (https://github.com/hcoles/pitest/issues/569), but the provided dependency doesn't work. Wondering if there is a solution, at least since kotest is obviously dealing with pitest at least somewhat, I figured others would have encountered this issue.
    s
    l
    • 3
    • 10
  • w

    wasyl

    09/08/2020, 10:30 AM
    I observe massive differences in performance when running individual spec in IDE vs the same spec running as part of entire module tests in console. For example one test in console reports as having taken 5 seconds, whereas that same test in IDE takes 165ms. Another test takes over 20 seconds (!) in console and under a second in IDE. Are there any known inefficiencies here? I’m using instance-per-leaf mode.
    s
    r
    • 3
    • 74
  • s

    Skolson5903

    09/09/2020, 12:59 AM
    Anybody got an example of a Kotest test for a gradle plugin in kotlin using GradleRunner that works? I'm trying for the first time, and getting this exception:
    Caused by: org.gradle.testkit.runner.InvalidPluginMetadataException: Test runtime classpath does not contain plugin metadata file 'plugin-under-test-metadata.properties'
       at org.gradle.testkit.runner.internal.PluginUnderTestMetadataReading.readImplementationClasspath(PluginUnderTestMetadataReading.java:44)
       at org.gradle.testkit.runner.internal.PluginUnderTestMetadataReading.readImplementationClasspath(PluginUnderTestMetadataReading.java:37)
       at org.gradle.testkit.runner.internal.DefaultGradleRunner.withPluginClasspath(DefaultGradleRunner.java:162)
        ...
    I've seen old posts about people seeing this specific error, and this plugin is supposed to help with an issue in IDEA:
    "com.palantir.idea-test-fix" version "0.1.0"
    but it doesn't help me. I didn't look into it so don't know what specifically this is doing. Anyway was hoping someone else has this working 🙂 Thanks in advance for any info. In case it's useful, here's the snippet causing the above error:
    val gradleRunner = GradleRunner.create()
            .withPluginClasspath()
            .withProjectDir(testProjectDir.root)
            .withTestKitDir(testProjectDir.newFolder())
    s
    m
    • 3
    • 28
  • j

    Jorge Castillo

    09/09/2020, 8:10 AM
    Hi, what would be the way to get the green play icons on latest Kotest stable? does it require an idea plugin?
    w
    s
    • 3
    • 4
  • t

    thol01

    09/09/2020, 8:42 AM
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':test'.
    > Could not resolve all files for configuration ':testRuntimeClasspath'.
       > Could not resolve com.github.ajalt.clikt:clikt-js:2.8.0.
         Required by:
             project : > io.kotest:kotest-runner-junit5:4.2.3 > io.kotest:kotest-runner-junit5-jvm:4.2.3 > io.kotest:kotest-framework-engine:4.2.3 > io.kotest:kotest-framework-engine-jvm:4.2.3 > com.github.ajalt:clikt:2.8.0
          > No matching variant of com.github.ajalt.clikt:clikt-js:2.8.0 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
              - Variant 'js-api' capability com.github.ajalt.clikt:clikt-js:2.8.0:
                  - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js' and the consumer needed a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
                  - Other compatible attributes:
                      - Doesn't say anything about its component category (required a library)
                      - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                      - Doesn't say anything about its target Java version (required compatibility with Java 11)
                      - Doesn't say anything about its elements (required them packaged as a jar)
              - Variant 'js-runtime' capability com.github.ajalt.clikt:clikt-js:2.8.0:
                  - Incompatible because this component declares a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js' and the consumer needed a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
                  - Other compatible attributes:
                      - Doesn't say anything about its component category (required a library)
                      - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                      - Doesn't say anything about its target Java version (required compatibility with Java 11)
                      - Doesn't say anything about its elements (required them packaged as a jar)
              - Variant 'metadata-api' capability com.github.ajalt.clikt:clikt-js:2.8.0:
                  - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
                  - Other compatible attributes:
                      - Doesn't say anything about its component category (required a library)
                      - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                      - Doesn't say anything about its target Java version (required compatibility with Java 11)
                      - Doesn't say anything about its elements (required them packaged as a jar)
       > Could not resolve com.github.ajalt.clikt:clikt-linuxx64:2.8.0.
         Required by:
             project : > io.kotest:kotest-runner-junit5:4.2.3 > io.kotest:kotest-runner-junit5-jvm:4.2.3 > io.kotest:kotest-framework-engine:4.2.3 > io.kotest:kotest-framework-engine-jvm:4.2.3 > com.github.ajalt:clikt:2.8.0
          > No matching variant of com.github.ajalt.clikt:clikt-linuxx64:2.8.0 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
              - Variant 'linuxX64-api' capability com.github.ajalt.clikt:clikt-linuxx64:2.8.0:
                  - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
                  - Other compatible attributes:
                      - Doesn't say anything about its component category (required a library)
                      - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                      - Doesn't say anything about its target Java version (required compatibility with Java 11)
                      - Doesn't say anything about its elements (required them packaged as a jar)
              - Variant 'metadata-api' capability com.github.ajalt.clikt:clikt-linuxx64:2.8.0:
                  - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
                  - Other compatible attributes:
                      - Doesn't say anything about its component category (required a library)
                      - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                      - Doesn't say anything about its target Java version (required compatibility with Java 11)
                      - Doesn't say anything about its elements (required them packaged as a jar)
       > Could not resolve com.github.ajalt.clikt:clikt-metadata:2.8.0.
         Required by:
             project : > io.kotest:kotest-runner-junit5:4.2.3 > io.kotest:kotest-runner-junit5-jvm:4.2.3 > io.kotest:kotest-framework-engine:4.2.3 > io.kotest:kotest-framework-engine-jvm:4.2.3 > com.github.ajalt:clikt:2.8.0
          > No matching variant of com.github.ajalt.clikt:clikt-metadata:2.8.0 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
              - Variant 'metadata-api' capability com.github.ajalt.clikt:clikt-metadata:2.8.0:
                  - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
                  - Other compatible attributes:
                      - Doesn't say anything about its component category (required a library)
                      - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                      - Doesn't say anything about its target Java version (required compatibility with Java 11)
                      - Doesn't say anything about its elements (required them packaged as a jar)
    • 1
    • 3
  • t

    thol01

    09/09/2020, 8:42 AM
    Hi, I get this error when i run gradlew (gradle version 6.6.1) using io.kotest:kotest-runner-junit5-jvm:4.2.3. But it does work with kotest 4.2.0.RC2.
    l
    s
    • 3
    • 145
  • b

    bbaldino

    09/10/2020, 8:02 PM
    I'm not very coroutines savvy, but I'm playing with a test and added a
    delay
    call inside of a
    should
    block and found it never seems to pick back up after the
    delay
    , is there a better way to do that? (I don't necessarily need it for the test, but was 'testing' the test and noticed the behavior)
    s
    l
    • 3
    • 16
  • m

    mitch

    09/11/2020, 9:29 PM
    @sam 2 questions, 1. on
    Arb.distinct
    what’s the actual intention behind that? i.e. what’s the behaviour that you would expect if that arb is called? Am i understanding this right?
    for any given arbitraries, return a uniformly distributed random elements based on a selector
    as in, if the input arb yields
    [1, 1, 1, 1, 1, 1, 1, 2]
    , the distinct arb would yield
    [1, 2, 1, 1, 2, 1, 2, 2]
    or something like that with equal sampling probability of
    1
    and
    2
    2. are you still keen on introducing Edgecases<A> for the combinatorial edgecases? I’m still working on that atm, but will only proceed if you are.
    l
    s
    • 3
    • 84
  • j

    Jordi Pradel

    09/16/2020, 11:31 AM
    Hi! What would you people recommend for nice console output with kotest nested tests? I tried
    com.adarshr.test-logger
    with BehaviorSpec but it prints "Givens" (outer tests names) after their inner tests, effectively printing everything in reverse order...
    👀 1
    s
    • 2
    • 2
  • j

    Jorrit

    09/17/2020, 11:17 AM
    Is there a way to run Kotest with a JS-only project? I can only find MPP and JVM setups.
    s
    • 2
    • 24
  • j

    Jorrit

    09/18/2020, 3:06 PM
    Say I wanted to output a lot of debug information with my tests, how would I do that? Seems "print" and such doesn't show up in the output (in IDEA's parsing)
    s
    l
    • 3
    • 3
Powered by Linen
Title
j

Jorrit

09/18/2020, 3:06 PM
Say I wanted to output a lot of debug information with my tests, how would I do that? Seems "print" and such doesn't show up in the output (in IDEA's parsing)
s

sam

09/18/2020, 3:10 PM
print should work, but IDEA does this thing where it hides certain output depending on what test you have highlighted.
✔️ 1
l

LeoColman

09/18/2020, 3:33 PM
I usually just print stuff and set breakpoints
I normally don't leave logs in my tests
View count: 4