Users/sveigraju/fix integ tests 2#3
Open
siri-varma wants to merge 87 commits into
Open
Conversation
…1608) (dapr#1746) Adds optional deadLetterTopic parameter to the streaming subscribe APIs on DaprPreviewClient / DaprClientImpl, wiring it through to the SubscribeTopicEventsRequestInitialAlpha1.dead_letter_topic proto field. New overloads: - subscribeToEvents(pubsubName, topic, deadLetterTopic, listener, type) - subscribeToTopic(pubsubName, topic, deadLetterTopic, type) - subscribeToTopic(pubsubName, topic, deadLetterTopic, type, metadata) Existing methods delegate to the new ones with a null deadLetterTopic, and the field is only set on the request when a non-empty value is provided. Adds unit tests covering both presence and absence of the field on the gRPC initial frame. Fixes: dapr#1608 Signed-off-by: Siri Varma Vegiraju <s_vegiraju@apple.com> Co-authored-by: Siri Varma Vegiraju <s_vegiraju@apple.com>
* chore: rewrite invoke/http example to use native HttpClient The DaprClient.invokeMethod wrappers were deprecated by dapr#1666. Rewrite the invoke/http sample to use java.net.http.HttpClient through the Dapr sidecar, demonstrating both URL forms accepted by the sidecar — the dapr-app-id header against the sidecar base URL, and the explicit /v1.0/invoke/<app-id>/method/<method> path. Update the matching README snippet and reduce expected_stdout_lines to 'Done' — the previous expected lines never matched what DemoService returns (a timestamp). Signed-off-by: Javier Aliaga <javier@diagrid.io> * feat: add DaprClient.invokeHttpClient(appId) factory Provides an SDK-native successor to the invokeMethod APIs deprecated by dapr#1666. DaprClient.invokeHttpClient(appId) returns a DaprInvokeHttpClient pre-bound to {daprHttpEndpoint}/v1.0/invoke/{appId}/method/ that reuses the SDK's shared java.net.http.HttpClient and attaches the dapr-api-token header when configured. Update the invoke/http example and README to demonstrate the new helper alongside the raw dapr-app-id header form. Signed-off-by: Javier Aliaga <javier@diagrid.io> * feat: add DaprBodyPublishers.json helper and invokeHttpClient migration notes Adds an opt-in DaprBodyPublishers.json(Object) helper backed by the SDK's default Jackson serializer, matching the JSON encoding the deprecated DaprClient.invokeMethod APIs applied internally. Eases migration without re-introducing auto-serialization into the raw HttpClient surface exposed by invokeHttpClient. Also fixes the invoke/http example README expected_stdout_lines to match the new plain-text body sent by the refactored example (Server: message one instead of Server: "message one"), and adds migration notes to the DaprClient.invokeHttpClient and DaprInvokeHttpClient Javadoc as well as the example README. Signed-off-by: Javier Aliaga <javier@diagrid.io> --------- Signed-off-by: Javier Aliaga <javier@diagrid.io>
* Apply suggestions from code review Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Refactor BookTripWorkflow to use CompensationHelper Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Add CompensationHelper class for managing compensations Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Await cancellation activities in BookTripWorkflow Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Add the new changes Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * fix violations Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Fix helper Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Modify readme Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Modify readme Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Modify readme Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Update copyright year and improve comment clarity Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Update copyright year to 2026 Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Update HistoryPropagationScope.java Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Update ActivityHistoryPropagationTest.java Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Change to 2026 Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Fix things Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Potential fix for pull request finding Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Hide chunk concept; expose WorkflowResult with typed lookups Address review feedback on dapr#1739: replace user-facing PropagatedHistoryChunk with WorkflowResult, mirroring dapr/durabletask-go#105. Adds typed ActivityResult and ChildWorkflowResult value types, and getLast*ByName / get*ByName lookups so callers don't walk raw history events. Renames getWorkflowByName to getLastWorkflowByName for symmetry with the new methods. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Bump copyright year to 2026 on PR files Address review feedback (dapr#1739): the new files in this PR were stamped 2025 - update them to 2026 to match the year the work is landing. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Surface PropagatedHistoryException at parse boundaries Address review feedback (dapr#1739): - TaskOrchestrationExecutor.execute: catch PropagatedHistoryException ahead of the generic Exception branch so a malformed payload is logged as a parse failure (not just "unhandled exception") before failing the context. - TaskActivityExecutor.execute: wrap PropagatedHistory.fromProto in a try/catch and rethrow PropagatedHistoryException with the activity name in the message, so the caller sees a typed parse failure rather than something that looks like a generic protobuf error. Adds tests for both paths driving a malformed PropagatedHistory chunk through each executor. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Address comments Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> --------- Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 6.0.0 to 6.0.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v6.0.0...v6.0.1) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 6.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Port the BookTrip compensation (Saga) workflow from the plain Java examples into the Spring Boot workflow patterns module, adding @Component-annotated activities and a /wfp/compensation REST endpoint. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Spec for migrating 13 sdk-tests integration tests from the dapr-run based BaseIT/DaprRun/AppRun harness to Testcontainers via DaprContainer. Captures architecture, startup ordering, per-IT plan, CI changes, and the 8 non-migrated ITs that stay on DaprRun. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
- Move ActorStateIT out of migration list (it's a sidecar-restart test). Migration count: 12 logical ITs / 13 files (9 non-migrated). - Add D9: per-class @BeforeAll lifecycle for all migrated ITs, with TracingIT mitigation (per-test trace IDs). - Add D10: each migrated IT subclass owns its own static DaprContainer + AppRun fields; BaseContainerIT provides helpers only, no fields. - Reconcile IT counts throughout (12 logical, 13 files migrated, 9 non-migrated, 22 total). Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
19-task plan covering: SharedTestInfra + BaseContainerIT foundation, AppRun port-override overload, 13 IT migrations (5 easy + 4 actor + 2 method-invoke + 2 tracing), CI compose-up trim, and push/observe. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
- Define final startAppAndAttach signature (returning DaprAndApp record) directly in Task 3 instead of refactoring it in Task 9. - Drop the startApp tombstone that threw UnsupportedOperationException. - Drop the unused newActorClient(dapr, ResiliencyOptions) overload — no migrated actor IT calls it (ActorSdkResiliencyIT is non-migrated). - Fix Task 15's Configuration constructor: it takes 3 args (name, tracing, appHttpPipeline); pass null for the last. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Provides a JVM-wide Network and lazy Redis container shared across all migrated integration tests. Uses withReuse(true) for dev-loop speed. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Lets BaseContainerIT point the spawned app subprocess at a Testcontainer DaprContainer's mapped HTTP/gRPC ports. Existing callers untouched. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
- Add Apache 2.0 license header to new files (matches package convention). - Change AppRun's new constructor overrides from Integer to int to remove NPE risk on a package-private API. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
BaseContainerIT lives in io.dapr.it.containers and Java packages are not hierarchical, so the constructor needs public visibility to be callable from the sub-package. Caught during Task 3 implementation. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Provides daprBuilder, startAppAndAttach (returning DaprAndApp record), newDaprClient(dapr), Component factories, and @afterall cleanup. Each subclass owns its own static DaprContainer + AppRun fields (D10 from the spec). Smoke test boots a no-component DaprContainer to verify the helper plumbing end-to-end. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Document the single-thread JUnit lifecycle assumption on the cleanup deques, clarify withReusablePlacement vs SharedTestInfra's withReuse, and distinguish the two deferStop overloads. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Boots Dapr via DaprContainer with secretstores.local.file pointing at a JSON payload generated in-memory and injected via withCopyToContainer (Transferable.of). No host file involvement. Drops initSecretFile/clearSecretFile/LOCAL_SECRET_FILE_PATH — workarounds for the old DaprRun harness writing to a shared host file. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Replaces double-brace HashMap initialization with Map.of to set a cleaner template for the 12 downstream IT migrations. Drops unused HashMap import. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Replaces in-method startDaprApp + run.checkRunState polling with a per-class DaprContainer in @BeforeAll and a dapr.isRunning() poll to verify shutdown. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Boots Dapr via DaprContainer with the redisConfigStore component, seeds the shared SharedTestInfra Redis via Jedis (replacing the previous docker-exec redis-cli shell-out which targeted the dapr_redis container). Adds jedis 5.1.0 as a sdk-tests test dependency. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
AbstractStateClientIT now extends BaseContainerIT instead of BaseIT. GRPCStateClientIT uses DaprContainer + redisStateStore (actor store enabled) per-class via @BeforeAll. The single MongoDB-dependent test (saveAndQueryAndDeleteState) is @disabled — out of scope for the Testcontainers migration per spec D9 / Non-Goals. QUERY_STATE_STORE constant is moved from the inherited BaseIT into AbstractStateClientIT locally since the @disabled test still references it (kept compilable for the eventual MongoDB-on-Testcontainers follow-up). Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Lazy-init openzipkin/zipkin on the shared Network with alias 'zipkin'. Used by TracingIT migrations in Phase 6 of the Testcontainers migration. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Uses startAppAndAttach to spawn MyActorService in a subprocess and wire the DaprContainer's appPort/appChannelAddress to host.testcontainers.internal. Adds a newActorClient(dapr, metadata) overload to BaseContainerIT for the second test which overrides Content-Length via actor metadata. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Lifecycle shifts from in-method startDaprApp to per-class @BeforeAll using startAppAndAttach with DemoActorService. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Per-class @BeforeAll using startAppAndAttach with MyActorService. buildManagedChannel reads gRPC port from dapr.getGrpcPort() (the DaprContainer's mapped port) instead of the global Properties.GRPC_PORT which would default to 50001 and miss the container's ephemeral port. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Per-class @BeforeAll using startAppAndAttach with MyActorService. Both proxy builders share the per-class actorClient. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
When legacy ITs run via `dapr run --resources-path ./components`, daprd scans every file in that directory looking for Component, Subscription, MCPServer, and WorkflowAccessPolicy resources. secret.json isn't a Dapr resource — it's the on-disk data for secretstores.local.file — so daprd emits four warnings per legacy test invocation about "non-YAML <kind> file secret.json was detected, it will not be loaded". Move secret.json to sdk-tests/secrets/secret.json and update secretstore.yaml accordingly. Migrated SecretsClientIT already inlines its secrets into the container via withCopyToContainer, so this only affects the legacy harness path. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Jackson deserializes the controller's List<BulkSubscribeAppResponse> return value to List<LinkedHashMap> at runtime (the generic parameter erases). The implicit cast inside the enhanced-for loop blew up with ClassCastException. Take the response as List<?> and convertValue each item from Object — matches the original code's pattern that used messages.get(0) to bypass the cast. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
The legacy BindingIT.httpOutputBindingError test asserted a 404 response from `https://api.github.com/unknown_path`. GitHub now returns 403 for unauthenticated requests to unknown paths, so the assertion fails. httpbin.org/status/404 is purpose-built to return whatever status code you ask for, eliminating the GitHub API-policy coupling. The component name stays as `github-http-binding-404` to avoid churning unrelated references in the test code — the historical name is harmless. Long-term, this test should be migrated to WireMock so the upstream behavior is fully under test control, but the URL swap unblocks CI now. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
This reverts commit f1efe9f. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
8202704 to
3e60255
Compare
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
…pr#1757) Signed-off-by: Javier Aliaga <javier@diagrid.io>
…odyPublishers.json scope (dapr#1758) newRequestBuilder now sets the User-Agent header to the SDK version, matching what the deprecated invokeMethod path emitted via DaprHttp. This is the only default the SDK can supply that callers cannot, and it is useful for runtime side triage. Other implicit invokeMethod behaviors (Content-Type default, request-id, error mapping, trace propagation) are intentionally left to the caller, since exposing the native HttpClient is the point of the migration. Also document on DaprBodyPublishers.json that the helper uses the SDK's default object serializer and is not a wrapper around a configured custom DaprObjectSerializer. Its only contribution over a plain ofByteArray call is guaranteeing a length-known BodyPublisher, which keeps the JDK on Content-Length framing and sidesteps the Transfer-Encoding: chunked race reported under load. Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
* use v1.18.0 Signed-off-by: Cassandra Coyle <cassie@diagrid.io> * update testcontainers Signed-off-by: Cassandra Coyle <cassie@diagrid.io> --------- Signed-off-by: Cassandra Coyle <cassie@diagrid.io> Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
dapr/durabletask-protobuf#51 reserved the unused router fields on ScheduleTaskAction (4) and CreateChildWorkflowAction (5), which broke compilation since protos are downloaded from main at build time. The runtime only reads the enclosing WorkflowAction.router, which was always set alongside the inner ones, so dropping the inner setters and their test assertions has no behavior change. Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
… completion (dapr#1769) When an orchestrator returns without calling ctx.complete(), the executor auto-completes only if no pending actions remain. Since dapr#1733 every waitForExternalEvent emits a CreateTimer action, so when the final event arrives in the same work item as the completion that resumed the orchestrator, the re-armed wait's timer is still pending when the function returns — blocking the implicit completion. The workflow stayed RUNNING until that timer fired: forever, for indefinite waits. Treat pending timers of already-resolved event waits as obsolete in the implicit-completion check. All other pending actions block completion as before. The regression test reconstructs the failing production history field-for-field. Signed-off-by: Javier Aliaga <javier@diagrid.io>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1774) newRequestBuilder resolves relativePath raw and now rethrows IllegalArgumentException on illegal chars (e.g. spaces), pointing at encodePath. encodePath percent-encodes each path segment, preserving separators and a leading slash and appending any query unchanged, mirroring DaprHttp/invokeMethod. Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
…workflow with an active instance ID (dapr#1782) * feat: throw WorkflowInstanceAlreadyExistsException when scheduling a workflow with an active instance ID Signed-off-by: Javier Aliaga <javier@diagrid.io> * fix: address Copilot review feedback on already-exists mapping Annotate nullable instanceId field, restrict the legacy fallback to UNKNOWN status with the runtime's specific collision message, and assert instance ID propagation into NewOrchestrationInstanceOptions. Signed-off-by: Javier Aliaga <javier@diagrid.io> --------- Signed-off-by: Javier Aliaga <javier@diagrid.io>
…ream on per-event error Addresses two review comments from Javier on PR dapr#1754: 1. Backoff was doubled up to 30s on every reconnect but never reset. Once a healthy stream disconnected after running for a while, the next reconnect (and every one thereafter) waited the capped 30s. Now the backoff resets to 1s if the just-terminated stream delivered at least one event. 2. The onNext catch-all called this.onError(...) which released the receiverStateChange semaphore and triggered a full reconnect on any per-event failure (e.g., a bad payload). It also did not actually cancel the gRPC stream. Now we just notify the listener via listener.onError(...) and keep the stream alive -- one bad event should not tear down the whole subscription. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Reverts all branch-local edits to sdk/src/main/java/io/dapr/client/ Subscription.java (commits 2dfc129, 52ba75f, 783a77d, ed8b398) so the file matches upstream/master. The backoff/error-handling changes will be revisited separately -- keeping this PR focused on the Testcontainers migration. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
…andling Restores ed8b398 (which was reverted in 731f319). Reverting to master caused failures; adding back both changes: 1. Reset reconnect backoff to 1s if the just-terminated stream had delivered at least one event (tracked per-stream via streamReceivedEvent). 2. On per-event errors in onNext, call listener.onError(...) instead of this.onError(...) so a single bad event does not tear down the whole subscription. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
New sdk/src/test/java/io/dapr/client/SubscriptionTest.java covers: - perEventExceptionKeepsStreamAlive: an exception thrown while handling an event must notify the listener without triggering a reconnect of the whole subscription. - backoffResetsAfterHealthyStreamDisconnect: reconnect backoff escalates on empty streams but resets to 1s once a stream has delivered at least one event. - closeInterruptsReconnectBackoff: close() must unblock the receiver even while it is sleeping in its reconnect backoff, so shutdown is not delayed by up to 30s. Subscription.close() now also interrupts the receiver thread so the third test passes and so real callers aren't blocked waiting for the receiver's Thread.sleep(backoffMs) to return. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
…1783) * feat: propagate caller trace context when scheduling workflows Upstream half of workflow trace propagation (follow-up to dapr#1619). DaprWorkflowClient gains a DaprWorkflowClient(Properties, Tracer) constructor that passes the tracer to the internal DurableTaskGrpcClientBuilder. DurableTaskGrpcClient now uses the configured tracer when scheduling: it emits a create_orchestration CLIENT span as a child of the caller's current OpenTelemetry context and stamps its W3C trace context into CreateInstanceRequest.parentTraceContext, so the workflow execution nests under the caller's trace instead of starting a separate one. Tracing stays opt-in: without a tracer the request is unchanged and no spans are emitted. The unused GlobalOpenTelemetry fallback is removed so the global instance is never pulled implicitly. Signed-off-by: Javier Aliaga <javier@diagrid.io> * fix: make scheduling span current during startInstance and record exceptions Addresses review feedback: the create_orchestration span is now current while the sidecar call runs, so nested instrumentation attaches to it, and failures record the exception on the span in addition to the error status. Signed-off-by: Javier Aliaga <javier@diagrid.io> --------- Signed-off-by: Javier Aliaga <javier@diagrid.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please explain the changes you've made
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #[issue number]
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: