Hi all, i'm running into an issue when running my ...
# kotest
t
Hi all, i'm running into an issue when running my test suite via the cli ( ie `gradle projecttest``). 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.
Copy code
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Strange Map type java.util.Map: cannot determine type parameters
     at [Source: (String)"{
      "data" : {
        "health" : "OK"
      }
    }"; line: 1, column: 1]
        at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:62)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:227)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:143)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:414)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
        at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)
        at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:491)
        at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4711)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4520)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3466)
        at com.expediagroup.graphql.client.GraphQLClient.execute(GraphQLClient.kt:91)
        at com.expediagroup.graphql.client.GraphQLClient$execute$1.invokeSuspend(GraphQLClient.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:238)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:194)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:144)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:238)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:194)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:144)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:238)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:194)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:144)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:238)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:194)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:144)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:238)
        at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:194)
        at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
        at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:144)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        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.core.runtime.ExecutorExecutionContext.executeWithTimeoutInterruption-D5N0EJY(ExecutorExecutionContext.kt:46)
        at io.kotest.core.runtime.TestCaseExecutor$executeAndWait$2.invokeSuspend(TestCaseExecutor.kt:188)
        at io.kotest.core.runtime.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.runtime.TestCaseExecutor.executeAndWait(TestCaseExecutor.kt:186)
        at io.kotest.core.runtime.TestCaseExecutor.invokeTestCase(TestCaseExecutor.kt:155)
        at io.kotest.core.runtime.TestCaseExecutor.executeActiveTest(TestCaseExecutor.kt:124)
        at io.kotest.core.runtime.TestCaseExecutor$intercept$2.invokeSuspend(TestCaseExecutor.kt:75)
        at io.kotest.core.runtime.TestCaseExecutor$intercept$2.invoke(TestCaseExecutor.kt)
        at io.kotest.core.runtime.TestCaseExecutor.executeIfActive(TestCaseExecutor.kt:89)
        at io.kotest.core.runtime.TestCaseExecutor.intercept(TestCaseExecutor.kt:75)
        at io.kotest.core.runtime.TestCaseExecutor.execute(TestCaseExecutor.kt:56)
        at io.kotest.core.engine.SingleInstanceSpecRunner.runTest(SingleInstanceSpecRunner.kt:60)
        at io.kotest.core.engine.SingleInstanceSpecRunner$execute$2$invokeSuspend$$inlined$invoke$lambda$1.invokeSuspend(SingleInstanceSpecRunner.kt:70)
        at io.kotest.core.engine.SingleInstanceSpecRunner$execute$2$invokeSuspend$$inlined$invoke$lambda$1.invoke(SingleInstanceSpecRunner.kt)
        at io.kotest.core.engine.SpecRunner$runParallel$$inlined$map$lambda$1$1.invokeSuspend(SpecRunner.kt:51)
        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.core.engine.SpecRunner$runParallel$$inlined$map$lambda$1.run(SpecRunner.kt:50)
        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
what are you doing at GraphQLClient.kt:91
t
sending a graphql query to a ktor server ... will check if its at the client or at the server sec
Ya so thats inside the expedia graphql client
s
It's jackson complaining that it can't work out your types. I see you're doing some type trickery with the parameterizedType method there
Confirm that the plugin is definitely running the test by putting an error("boom") in the test and making sure it goes red in intellij
t
so it runs fine when i use the kotest plugin to run the test
its only when running the test via the cli that i get the error
err nvm thats not true
it is failing via the pluging as well ... will add the error
s
Yeah I don't see why kotest would affect this - I think you've got some type parameters that are being erased by the JVM so jackson can't marshall to your type
t
hmm let me see if adding more explicit types help
s
that's a funky intellij theme
t
dracula!
πŸ‘πŸ» 1
Hmm im going to have to call it and come back to this tomorrow nearly midnight here!
thanks for you help
sadly the problem persists i've just tried a few other tests which pass in kotest but fail in the cli 😞
Got to run but appreciate any thoughts as to why it works in one but not the other πŸ™
h
@tim I have the same problem, turned out for me that the graphql client did not like working together with spring-boot2.3.3RELEASE. Wirh 2.3.1.RELEASE it works fine. I saw that with 2.3.3 the jackson library is upgraded from 2.11.0 to 2.11.2, maybe that is the issue? What are your circumstances? I did not find a solution for me yet, but would think maybe this is a discussion for the #spring channel? πŸ€”
t
Hey, @huehnerlady i'm using ktor so not a spring issue for me. I am on 2.11.2 but still no joy 😞 Does it work for you when running tests from inside intellij but fails when running via the cli w/ gradle?
h
I see, I just saw the issue while running a request, has nothing to do with tests for me. still are you using jackson?
t
i am using jackson ya
baiscally my setup is jackson + ktor + graphql server and client
h
which jackson Version do you use? I use a graphql client too and with jackson 2.11.0 it works fine, but with 2.11.2 it does not work anymore
t
i'm on 2.11.2 but it does work for me when running it and when testing it via kotest
it only fails when running tests via gradle πŸ€”
h
hmm very strange
t
ya totally confused!
h
sorry then I cannot help you. for me it didn’t work running it with 2.11.2 but works with 2.11.0, maybe try using 2.11.0 just to be sure?
t
okay ya ill give 2.11.0 a try
ahh brilliant 2.11.0 fixed it πŸ™
h
yeah maybe this is something to create an issue in the graphql client for? or ktor?? πŸ€”
t
or jackson πŸ€”
lol
too many projects at the intersection of this
πŸ˜‚ 1
h
πŸ˜‰