dapr / dotnet-sdk

Dapr SDK for .NET
Apache License 2.0
1.11k stars 331 forks source link

How to run the Actor tests in the DevContainer? #1342

Open paule96 opened 2 weeks ago

paule96 commented 2 weeks ago

Ask your question here

I tried lately to contribute to the dapr-sdk for dotnet. I was happy to see that there is a DevContainer configured for this repository. Sadly it seems to be not anymore maintained. I first added the missing dotnet SDKs (7 & 8), which let me successfully build and develop the code. After that I tried to run the tests. Some of the tests require dapr to be initialized. So I did run dapr init.

After that the tests are still failing the following errors:

Version 1:

---- System.Exception : Command: "run --app-id serializerapp --dapr-http-port 45969 --dapr-grpc-port 41649 --metrics-port 39537 --components-path ./../../../../../test/Dapr.E2E.Test/components --config ./../../../../../test/Dapr.E2E.Test/configuration/featureconfig.yaml --log-level debug --app-port 44271 -- dotnet run --project ./../../../../../test/Dapr.E2E.Test.App/Dapr.E2E.Test.App.csproj --framework net6 -- 44271 --urls http://localhost:44271 --json-serialization" timed out while waiting for output: "System.String[]"

Version 2:

Flag --components-path has been deprecated, This flag is deprecated and will be removed in the future releases. Use "resources-path" flag instead
ℹ️Starting Dapr with id serializerapp. HTTP Port: 34887. gRPC Port: 38055
Flag --components-path has been deprecated, use --resources-path
Flag --dapr-http-max-request-size has been deprecated, use '--max-body-size 4Mi'
Flag --dapr-http-read-buffer-size has been deprecated, use '--read-buffer-size 4Ki'
time="2024-08-28T07:28:44.155062526Z" level=info msg="Starting Dapr Runtime -- version 1.14.1 -- commit 81cb1f5c4709535b03799e7e1826fbab0315b90b" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.155088148Z" level=info msg="Log level set to: debug" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.155301613Z" level=warning msg="mTLS is disabled. Skipping certificate request and tls validation" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.security type=log ver=1.14.1
time="2024-08-28T07:28:44.155458268Z" level=debug msg="Loading config from file(s): ./../../../../../test/Dapr.E2E.Test/configuration/featureconfig.yaml" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.155632038Z" level=info msg="Enabled features: Actor.Reentrancy proxy.grpc ActorStateTTL" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.155654837Z" level=info msg="metric spec: {0xc001df60a6 <nil> <nil> []}" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.diagnostics type=log ver=1.14.1
time="2024-08-28T07:28:44.155668861Z" level=info msg="Using default latency distribution buckets: [1 2 3 4 5 6 8 10 13 16 20 25 30 40 50 65 80 100 130 160 200 250 300 400 500 650 800 1000 2000 5000 10000 20000 50000 100000]" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.diagnostics type=log ver=1.14.1
time="2024-08-28T07:28:44.155777756Z" level=warning msg="The default value for 'spec.metric.http.increasedCardinality' will change to 'false' in Dapr 1.15 or later" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.diagnostics type=log ver=1.14.1
time="2024-08-28T07:28:44.156064316Z" level=debug msg="Found 0 resiliency configurations in resources path" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.156122256Z" level=info msg="Initializing connection to Scheduler in the background" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.156137191Z" level=debug msg="Attempting to connect to Scheduler at address: localhost:50006" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.scheduler.clients type=log ver=1.14.1
time="2024-08-28T07:28:44.156324735Z" level=info msg="Scheduler client initialized for address: localhost:50006" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.scheduler.clients type=log ver=1.14.1
time="2024-08-28T07:28:44.156338995Z" level=info msg="Scheduler client connections created" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.156373106Z" level=debug msg="Hot reloading disabled" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.hotreload type=log ver=1.14.1
time="2024-08-28T07:28:44.15640501Z" level=info msg="standalone mode configured" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.15642832Z" level=info msg="app id: serializerapp" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.156482008Z" level=info msg="Dapr trace sampler initialized: ParentBased{root:AlwaysOnSampler,remoteParentSampled:AlwaysOnSampler,remoteParentNotSampled:AlwaysOffSampler,localParentSampled:AlwaysOnSampler,localParentNotSampled:AlwaysOffSampler}" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.1564946Z" level=info msg="metrics server started on :41741/" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.156699905Z" level=info msg="local service entry announced: serializerapp -> 172.17.0.5:33703" app_id=serializerapp component="nr (mdns/v1)" instance=8491b9a3b59a scope=dapr.contrib type=log ver=1.14.1
time="2024-08-28T07:28:44.15671974Z" level=info msg="Initialized name resolution to mdns" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.156755914Z" level=info msg="Loading components…" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.157120155Z" level=debug msg="Found component: pubsub (pubsub.redis)" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.157153674Z" level=debug msg="Found component: statestore (state.redis)" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.157168473Z" level=debug msg="Loading component: pubsub (pubsub.redis)" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.processor type=log ver=1.14.1
time="2024-08-28T07:28:44.292064513Z" level=error msg="Failed to init component pubsub (pubsub.redis): [INIT_COMPONENT_FAILURE]: initialization error occurred for pubsub (pubsub.redis): redis streams: error connecting to redis at localhost:6379: dial tcp [::1]:6379: connect: connection refused" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.processor type=log ver=1.14.1
time="2024-08-28T07:28:44.292108841Z" level=warning msg="Error processing component, daprd will exit gracefully: process component pubsub error: [INIT_COMPONENT_FAILURE]: initialization error occurred for pubsub (pubsub.redis): [INIT_COMPONENT_FAILURE]: initialization error occurred for pubsub (pubsub.redis): redis streams: error connecting to redis at localhost:6379: dial tcp [::1]:6379: connect: connection refused" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.processor type=log ver=1.14.1
time="2024-08-28T07:28:44.292129992Z" level=info msg="Waiting for all outstanding components to be processed…" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.292139892Z" level=info msg="All outstanding components processed" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.292153998Z" level=info msg="Loading endpoints…" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.292343319Z" level=info msg="Waiting for all outstanding http endpoints to be processed…" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.29236158Z" level=info msg="All outstanding http endpoints processed" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.292367113Z" level=info msg="Loading Declarative Subscriptions…" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.292519129Z" level=debug msg="Refreshing channels" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.channels type=log ver=1.14.1
time="2024-08-28T07:28:44.292541095Z" level=debug msg="Channels refreshed" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.channels type=log ver=1.14.1
time="2024-08-28T07:28:44.292596264Z" level=info msg="gRPC server listening on TCP address: :38055" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.grpc.api type=log ver=1.14.1
time="2024-08-28T07:28:44.292614663Z" level=info msg="Enabled gRPC tracing middleware" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.grpc.api type=log ver=1.14.1
time="2024-08-28T07:28:44.292619358Z" level=info msg="Enabled gRPC metrics middleware" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.grpc.api type=log ver=1.14.1
time="2024-08-28T07:28:44.292676727Z" level=info msg="Registering workflow engine for gRPC endpoint: [::]:38055" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.grpc.api type=log ver=1.14.1
time="2024-08-28T07:28:44.292717791Z" level=info msg="API gRPC server is running on port 38055" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.29274426Z" level=warning msg="The default value for 'spec.metric.http.increasedCardinality' will change to 'false' in Dapr 1.15 or later" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.http type=log ver=1.14.1
time="2024-08-28T07:28:44.292774334Z" level=info msg="Enabled max body size HTTP middleware with size 4194304 bytes" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.http type=log ver=1.14.1
time="2024-08-28T07:28:44.292788436Z" level=info msg="Enabled tracing HTTP middleware" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.http type=log ver=1.14.1
time="2024-08-28T07:28:44.292791874Z" level=info msg="Enabled metrics HTTP middleware" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.http type=log ver=1.14.1
time="2024-08-28T07:28:44.292972571Z" level=info msg="HTTP server listening on TCP address: :34887" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.http type=log ver=1.14.1
time="2024-08-28T07:28:44.293005583Z" level=info msg="HTTP server is running on port 34887" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.293009107Z" level=info msg="The request body size parameter is: 4194304 bytes" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.293028407Z" level=info msg="gRPC server listening on TCP address: :33703" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.grpc.internal type=log ver=1.14.1
time="2024-08-28T07:28:44.293033266Z" level=info msg="Enabled gRPC tracing middleware" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.grpc.internal type=log ver=1.14.1
time="2024-08-28T07:28:44.293036029Z" level=info msg="Enabled gRPC metrics middleware" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.grpc.internal type=log ver=1.14.1
time="2024-08-28T07:28:44.293063281Z" level=info msg="Internal gRPC server is running on :33703" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.293111728Z" level=info msg="application protocol: http. waiting on port 40413.This will block until the app is listening on that port." app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.293159131Z" level=info msg="Shutting down workflow engine" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.29318756Z" level=debug msg="Graceful shutdown timeout: 5s" app_id=serializerapp instance=8491b9a3b59a scope=dapr.kit.concurrency type=log ver=1.14.1
time="2024-08-28T07:28:44.293223142Z" level=info msg="Closing HTTP server [::]:34887…" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime.http type=log ver=1.14.1
time="2024-08-28T07:28:44.293225534Z" level=debug msg="stopping cache refreshes" app_id=serializerapp component="nr (mdns/v1)" instance=8491b9a3b59a scope=dapr.contrib type=log ver=1.14.1
time="2024-08-28T07:28:44.293174437Z" level=info msg="Dapr is shutting down" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.293251891Z" level=info msg="Dapr runtime stopped" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
time="2024-08-28T07:28:44.293243093Z" level=debug msg="received done signal, shutting down…" app_id=serializerapp component="nr (mdns/v1)" instance=8491b9a3b59a scope=dapr.contrib type=log ver=1.14.1
time="2024-08-28T07:28:44.29325727Z" level=info msg="stopping mDNS server for app id: serializerapp" app_id=serializerapp component="nr (mdns/v1)" instance=8491b9a3b59a scope=dapr.contrib type=log ver=1.14.1
time="2024-08-28T07:28:44.293419813Z" level=fatal msg="Fatal error from runtime: process component pubsub error: [INIT_COMPONENT_FAILURE]: initialization error occurred for pubsub (pubsub.redis): [INIT_COMPONENT_FAILURE]: initialization error occurred for pubsub (pubsub.redis): redis streams: error connecting to redis at localhost:6379: dial tcp [::1]:6379: connect: connection refused" app_id=serializerapp instance=8491b9a3b59a scope=dapr.runtime type=log ver=1.14.1
❌The daprd process exited with error code: exit status 1
⚠Could not update sidecar metadata for cliPID: PUT http://127.0.0.1:34887/v1.0/metadata/cliPID giving up after 5 attempt(s): Put "http://127.0.0.1:34887/v1.0/metadata/cliPID": dial tcp 127.0.0.1:34887: connect: connection refused
ℹ️Updating metadata for appPID: 19997
❌failed to stop app id serializerapp: couldn't find app id serializerapp
Dapr app: serializerapp

Client App:

2024-08-28 07:28:46.930 +00:00 [WRN] Storing keys in a directory '/home/vscode/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
2024-08-28 07:28:46.936 +00:00 [INF] User profile is available. Using '/home/vscode/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
2024-08-28 07:28:46.970 +00:00 [INF] WorkflowLoggingService started
2024-08-28 07:28:46.970 +00:00 [INF] List of registered workflows
2024-08-28 07:28:46.970 +00:00 [INF] PlaceOrder
2024-08-28 07:28:46.970 +00:00 [INF] List of registered activities:
2024-08-28 07:28:46.970 +00:00 [INF] ShipProduct
2024-08-28 07:28:46.984 +00:00 [INF] Durable Task gRPC worker starting.
2024-08-28 07:28:47.049 +00:00 [INF] The gRPC server for Durable Task gRPC worker is unavailable. Will continue retrying.
2024-08-28 07:28:47.137 +00:00 [INF] Now listening on: http://localhost:40413
2024-08-28 07:28:47.137 +00:00 [INF] Application started. Press Ctrl+C to shut down.
2024-08-28 07:28:47.137 +00:00 [INF] Hosting environment: Production
2024-08-28 07:28:47.137 +00:00 [INF] Content root path: /workspaces/dotnet-sdk/test/Dapr.E2E.Test.App
2024-08-28 07:28:52.050 +00:00 [INF] The gRPC server for Durable Task gRPC worker is unavailable. Will continue retrying.

Last line is repeating infinitly.

The test that fails always is: CustomSerializerTests

paule96 commented 2 weeks ago

No help is needed anymore. Got it by myself and merged it into my other contribution. :)