JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.91k stars 1.16k forks source link

KJS / Compose Web: "NoSuchMethodError: 'void org.gradle.api.internal.tasks.testing.TestResultProcessor.failure" when running jsNodeTest #2610

Open igordmn opened 1 year ago

igordmn commented 1 year ago

Moved from https://youtrack.jetbrains.com/issue/KT-55779

What steps will reproduce the issue?

Project attached

  1. run /gradlew jsNodeTest

What is the expected result?

The Gradle test task passes or fails

What happens instead?

> Task :jsNodeTest FAILED
Could not read standard output of command '/.../.local/share/gradle/nodejs/node-v16.13.0-darwin-x64/bin/node'.
java.lang.NoSuchMethodError: 'void org.gradle.api.internal.tasks.testing.TestResultProcessor.failure(java.lang.Object, java.lang.Throwable)'
        at org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessagesClient.failure(TCServiceMessagesClient.kt:176)
        at org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessagesClient.serviceMessage(TCServiceMessagesClient.kt:78)
        at jetbrains.buildServer.messages.serviceMessages.ServiceMessagesParser.parse(ServiceMessagesParser.java:54)
        at jetbrains.buildServer.messages.serviceMessages.ServiceMessage.parse(ServiceMessage.java:121)
        at org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessageOutputStreamHandler.parse(TCServiceMessageOutputStreamHandler.kt:121)
        at org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessageOutputStreamHandler.flushLine(TCServiceMessageOutputStreamHandler.kt:81)
        at org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessageOutputStreamHandler.write(TCServiceMessageOutputStreamHandler.kt:61)
        at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:67)
        at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)
        at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':kotka-streams-site:jsNodeTest'.
> 'void org.gradle.api.internal.tasks.testing.TestResultProcessor.failure(java.lang.Object, java.lang.Throwable)'
jillesvangurp commented 1 year ago

Running into this as well with test failures with kotlin-js node.js tests (mocha). Works in gradle 7.5.1, broke in gradle 7.6.0. Looks like some internal gradle APIs changed?

This is how we configure the javascript build:

    js(IR) {
        nodejs {
            testTask {
                useMocha {
                    timeout = "20000"
                }
                testLogging.showStandardStreams=true
            }
        }
    }

any simple test that fails should reproduce this

import kotlin.test.Test

class TestIt {
    @Test
    fun fail() {
        error("oops")
    }
}
Unable to find method ''void org.gradle.api.internal.tasks.testing.TestResultProcessor.failure(java.lang.Object, java.lang.Throwable)''
'void org.gradle.api.internal.tasks.testing.TestResultProcessor.failure(java.lang.Object, java.lang.Throwable)'

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Rolling back to gradle 7.5.1 fixes things.

xuanswe commented 1 year ago

I have exactly the issue with kotlin-react. Downgrade to Gradle 7.5.1 fixed the error.

okushnikov commented 2 weeks ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.