.NET: Add tests for subworkflow shared state behavior#3444
Merged
Conversation
66a19e8 to
750bbc9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive test coverage for shared state behavior in subworkflows, documenting both working and isolated state scenarios. The tests verify that shared state operates correctly within a subworkflow while also documenting the current limitation where state is isolated across parent/subworkflow boundaries (issue #2419).
Changes:
- Added test file documenting shared state behavior in subworkflows with three executor classes that pass data through shared state
- Added two test methods validating shared state works within subworkflows and is isolated across boundaries
- Implemented helper methods to run different workflow configurations for testing state persistence
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| SampleSmokeTest.cs | Added two test methods to verify shared state behavior within and across subworkflow boundaries |
| 14_Subworkflow_SharedState.cs | New test file containing executor implementations and workflow configurations for testing shared state scenarios |
dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/14_Subworkflow_SharedState.cs
Outdated
Show resolved
Hide resolved
750bbc9 to
bb6b25e
Compare
Adds tests documenting current shared state behavior in subworkflows: - State works correctly within a subworkflow - State is isolated across parent/subworkflow boundaries Related to #2419
bb6b25e to
d8685e1
Compare
westey-m
approved these changes
Jan 27, 2026
SergeyMenshykh
approved these changes
Jan 27, 2026
This was referenced Jan 28, 2026
This was referenced Jan 29, 2026
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
Adds tests documenting current shared state behavior in subworkflows:
Related to #2419
Contribution Checklist
Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.