Skip to content

test(streaming): cover JSON converter read contracts - #10884

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-issue-10862-streaming-coverage
Aug 28, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-issue-10862-streaming-coverage

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Problem

The highest-risk streaming JSON read paths had substantial uncovered branches around discriminator handling, malformed shapes, keyed-provider resolution, and stream identity reconstruction.

Solution

  • Add 34 deterministic BVT cases for EventSequenceTokenJsonConverter.Read and AsyncStreamConverter.Read.
  • Cover exact token type, sequence/index ordering, stream provider/namespace/key/rewindability identity, malformed and incomplete payloads, type mismatches, unsupported discriminators, missing/incompatible providers, and exact provider-activation failure propagation.
  • Use synchronous JSON readers and keyed in-memory DI, with assertions that deserialization performs no producer or consumer lifecycle operations.

Coverage impact

Method Baseline line / branch With this PR
AsyncStreamConverter.Read 74.19% / 62.50% 100% / 100%
EventSequenceTokenJsonConverter.Read 70.37% / 60.00% 100% / 100%

This is the first mergeable slice of the broader streaming and broadcast coverage work.

Part of #10862

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings August 28, 2026 01:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Lite
Findings: None

What changed in this PR

Adds deterministic contract tests to increase branch/line coverage for Orleans streaming JSON deserialization, focusing on EventSequenceTokenJsonConverter.Read and AsyncStreamConverter.Read behavior in both valid and failure-path inputs.

Changes:

  • Introduces BVT theory/fact tests validating discriminator handling and concrete-type selection for StreamSequenceToken deserialization.
  • Adds tests for IAsyncStream<T> JSON read paths covering identity reconstruction, malformed payloads, missing/incompatible keyed providers, and provider activation failures.
  • Verifies deserialization does not invoke stream provider lifecycle/operation APIs.
File Description
test/​Orleans.Streaming.Tests/​JsonConverters/​StreamingJsonConverterTests.cs Adds targeted BVT coverage for streaming JSON converter read contracts, including malformed payload and DI/provider resolution paths.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Code coverage

78.61% line coverage - 99,529 / 126,605 lines

Coverage details

@ReubenBond
ReubenBond merged commit 26d2995 into dotnet:main Aug 28, 2026
76 checks passed
@ReubenBond
ReubenBond deleted the rb-issue-10862-streaming-coverage branch August 28, 2026 06:47
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants