昨天我正在我的代碼庫,當服務已行將就木,我跑我的單元測試對我的代碼的時候,突然我看到這個的想法日誌:IDEA IllegalStateException異常:與科特林運行JUnit測試
Error:Kotlin: [Internal Error] java.lang.IllegalStateException: Service is dying at org.jetbrains.kotlin.daemon.common.CompileService$CallResult$Dying.get(CompileService.kt:60) at org.jetbrains.kotlin.daemon.common.CompileService$CallResult$Dying.get(CompileService.kt:59) at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner.compileWithDaemon(JpsKotlinCompilerRunner.kt:127) at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner.compileWithDaemonOrFallback(JpsKotlinCompilerRunner.kt:100) at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner.compileWithDaemonOrFallback(JpsKotlinCompilerRunner.kt:35) at org.jetbrains.kotlin.compilerRunner.KotlinCompilerRunner.runCompiler(KotlinCompilerRunner.kt:115) at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner.runK2JvmCompiler(JpsKotlinCompilerRunner.kt:65) at org.jetbrains.kotlin.jps.build.KotlinBuilder.compileToJvm(KotlinBuilder.kt:740) at org.jetbrains.kotlin.jps.build.KotlinBuilder.doCompileModuleChunk(KotlinBuilder.kt:458) at org.jetbrains.kotlin.jps.build.KotlinBuilder.doBuild(KotlinBuilder.kt:264) at org.jetbrains.kotlin.jps.build.KotlinBuilder.build(KotlinBuilder.kt:181) at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1282) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:956) at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1028) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:915) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:741) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:387) at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:195) at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138) at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:295) at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125) at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:238) at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:44) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
這是四月份來自JetBrains的傻瓜笑話嗎?
我從來沒有見過這個。 killall java
和一個IDEA重新啓動解決了這個問題,我無法重現這一點。在編譯Kotlin代碼時,是否有這樣的記錄(我沒有在Google上找到任何匹配)或IDEA中的一次性故障? 這個錯誤是什麼意思?
注意我跑了單元測試是一個簡單的試驗探索,我認爲這是無關緊要的位置:
internal fun fetchAsListWithSiblings(): List<Message<T>> {
val first = this
var currentMsg = first
val result = mutableListOf(currentMsg)
while(currentMsg.next.isPresent) {
val next = currentMsg.next.get()
currentMsg = next
result.add(next)
}
return result
}
@Test
fun shouldFetchSiblingsWhenFetchSiblingsIsCalledWithMultipleSiblings() {
val expected = listOf("foo", "bar", "baz")
val messages = Message.createMultiple(expected)
assertThat(messages.fetchAsListWithSiblings().map { it.payload }).isEqualTo(expected)
}
「_這是四月份來自JetBrains的傻瓜笑話嗎?」並不是提問的重要部分。 –