camunda / zeebe-process-test

Testing project for Camunda Platform 8
41 stars 15 forks source link

[8.6.4] The Zeebe client reports the error: Panic! This is a bug! #1257

Open saig0 opened 1 day ago

saig0 commented 1 day ago

Description

ZPT in version 8.6.4 is broken. If I use the injected client to send a command, it reports the following error:

io.camunda.zeebe.client.api.command.ClientStatusException: Panic! This is a bug!

    at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.transformExecutionException(ZeebeClientFutureImpl.java:116)
    at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.join(ZeebeClientFutureImpl.java:54)
    at io.jp.zeebeprocesstest.ZeebeProcessTestApplicationTests.testDeployment(ZeebeProcessTestApplicationTests.java:36)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
    at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
    at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
    at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.join(ZeebeClientFutureImpl.java:52)
    ... 4 more
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
    at io.grpc.Status.asRuntimeException(Status.java:533)
    at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:481)
    at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:489)
    at io.grpc.internal.DelayedClientCall$DelayedListener.drainPendingCallbacks(DelayedClientCall.java:528)
    at io.grpc.internal.DelayedClientCall$1DrainListenerRunnable.runInContext(DelayedClientCall.java:317)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NoSuchMethodError: 'io.grpc.Status io.grpc.NameResolver$Listener2.onResult2(io.grpc.NameResolver$ResolutionResult)'
    at io.grpc.internal.DnsNameResolver$Resolve.lambda$run$0(DnsNameResolver.java:334)
    at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:94)
    at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:126)
    at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:333)
    ... 3 more

The root cause is a dependency issue between the ZPT test engine and the Zeebe client.

The mismatch of the gRPC version causes the issue.

Expected behaviour

I can use the injected client to send commands.

Reproduction steps

Test code ``` @ZeebeProcessTest class ZeebeProcessTestApplicationTests { private ZeebeTestEngine engine; private ZeebeClient client; private RecordStream recordStream; @Test void testDeployment() throws Exception { DeploymentEvent event = client .newDeployResourceCommand() .addResourceFromClasspath("testDateRule.dmn") .addResourceFromClasspath("sampleProcess.bpmn") .send() .join(); // <-- fails here } } ```

Environment

saig0 commented 1 day ago

Workaround

Pin the version of gRPC in the pom.xml to 1.68.0:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-bom</artifactId>
                <version>1.68.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>