dotnet / dotnet/orleans

test(streaming): raise streaming and broadcast coverage above 90%

Open
#10,862 0 comments 0 reactions 0 assignees View on GitHub
area-streaming area-testing test
Dominant language
C#
Stars
10.9k
Forks
2.1k
Avg merge
14h 42m
Merged PRs (30d)
354

Description

## Goal

Raise Orleans streaming and broadcast-channel coverage above 90%, prioritizing serialization contracts, queue balancing, producer/consumer lifecycle, and failure paths.

Coverage report: https://github.com/dotnet/orleans/runs/98679059570

## Measured gaps

- `Orleans.Streaming` has roughly 840 uncovered physical source lines and is near 81% line coverage.
- Broadcast channels are near 65% line coverage.
- `AsyncStreamConverter.Read`: 0% coverage, complexity 24, CRAP 600.
- `EventSequenceTokenJsonConverter.Read`: 0% coverage, complexity 20, CRAP 420.
- `StreamId`/`InternalStreamId` JSON parsing and property-name paths have low branch coverage.
- Queue-balancer, subscription, producer/consumer lifecycle, cache, and error paths remain below target.

## Work

- [ ] Round-trip stream IDs, qualified IDs, async streams, and event sequence tokens in value and dictionary-key forms.
- [ ] Cover null namespaces, Unicode, event indexes, malformed JSON shapes, invalid discriminators/type mismatches, missing keyed providers, and default values.
- [ ] Exercise queue-balancer ownership changes and lease failure/recovery deterministically.
- [ ] Cover producer/consumer completion, error, unsubscribe, reconnect, and duplicate-subscription outcomes.
- [ ] Add focused broadcast-channel lifecycle and observer-failure coverage.
- [ ] Reuse fake providers and in-memory fixtures for contract tests; reserve external-provider behavior for provider-specific issues.
- [ ] Review reachable `NotImplementedException` paths such as producer completion/error callbacks and either implement or explicitly test the supported runtime contract.

## Acceptance criteria

- Streaming and broadcast packages reach at least 90% line coverage and materially improve branch coverage.
- Listed JSON converter methods reach at least 80% line and 70% branch coverage with CRAP below 30.
- Tests assert delivery, ordering, identity, retry, and lifecycle outcomes.
- Provider-specific service coverage remains in the cloud-provider issue to avoid duplication.

Contributor guide

Open the contributing guide

Research direction

Start with the linked coverage report and the named AsyncStreamConverter.Read and EventSequenceTokenJsonConverter.Read paths, then inspect the existing fake providers and in-memory fixtures. Cover the listed serialization, lifecycle, queue-balancer, and failure cases; done means both streaming and broadcast packages reach 90% line coverage and the stated converter thresholds.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
distributed-systems, testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.