Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add actor testcontainer tests #1192

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

akkie
Copy link

@akkie akkie commented Jan 16, 2025

Description

This PR adds testcontainer based integration tests for actors. This is to make sure that actors really work with testcontainers.

Issue reference

This PR was crated based on a Discord discussion with @salaboy to check if actors works with testcontainers.

@akkie akkie requested review from a team as code owners January 16, 2025 07:03
@akkie
Copy link
Author

akkie commented Jan 16, 2025

@salaboy I have currently the problem that the test fails with the following exception when trying to connect to the Dapr gRPC port.

Caused by: io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:50001
Caused by: java.net.ConnectException: Connection refused
        at java.base/sun.nio.ch.Net.pollConnect(Native Method)
        at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)
        at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:1062)
        at io.grpc.netty.shaded.io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:336)
        at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:339)
        at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
        at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
        at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
        at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
        at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
        at io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:1575)

Not sure why it uses port 50001, because this is the internal port. I think normally it should use the mapped port. Maybe you can have a look, if the test is not correct configured?

@salaboy
Copy link
Contributor

salaboy commented Jan 17, 2025

@akkie thanks a lot of this.. give me some time to look into this.. check the DCO, we need that to approve the PR. Click on the Details link to see the steps to fix it.

@akkie
Copy link
Author

akkie commented Jan 20, 2025

@salaboy Is it OK if I do a force push regarding the update of the DCO?

@salaboy
Copy link
Contributor

salaboy commented Jan 20, 2025

@akkie yeah.. that is your fork.. so it is ok

Signed-off-by: Christian Kaps <[email protected]>
@akkie akkie force-pushed the actor-testcontainer branch from ee83cff to bec4bd2 Compare January 20, 2025 12:54
@salaboy
Copy link
Contributor

salaboy commented Jan 22, 2025

@akkie would you mind adding me as a collaborator to your fork? I am working on a fix, but I would love to push to your fork.. if not I can send you a patch to apply to your fork with the fix

@akkie
Copy link
Author

akkie commented Jan 22, 2025

@akkie would you mind adding me as a collaborator to your fork? I am working on a fix, but I would love to push to your fork.. if not I can send you a patch to apply to your fork with the fix

Done

@salaboy
Copy link
Contributor

salaboy commented Jan 22, 2025

@akkie I will push two commits to your fork, I am stuck with a new error now.. but at least the connection is working now.

@salaboy
Copy link
Contributor

salaboy commented Jan 22, 2025

Now I am stuck with this:

time="2025-01-22T17:41:56.55236659Z" level=debug msg="api error: code = Internal desc = error invoke actor method: did not find address for actor TestActor/f5893dd3-9d9c-4405-859e-b0c3b6aa2988" app_id=actor-dapr-app instance=780ae8017e66 scope=dapr.runtime.grpc.api type=log ver=1.14.1


io.dapr.exceptions.DaprException: INTERNAL: error invoke actor method: did not find address for actor TestActor/f5893dd3-9d9c-4405-859e-b0c3b6aa2988

But the connection is working as far as I can tell.

@salaboy
Copy link
Contributor

salaboy commented Jan 22, 2025

This is strange.. because it looks like we are hitting this: dapr/dapr#6783

https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/actors/DemoActorClient.java

@artursouza do you know if these examples are executed as part of the tests?

@akkie
Copy link
Author

akkie commented Jan 22, 2025

@salaboy This is exactly the message we get with our testcontainer setup:

fails to send binding event to http app channel, status code: 500 body: Dapr.DaprApiException: error invoke actor method: did not find address for actor

We use .NET and not Java.

@salaboy
Copy link
Contributor

salaboy commented Jan 22, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants