GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(testing): add IGrainStorage provider test kit by ReubenBond · Pull Request #10490 · dotnet/orleans

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 11, 2026 •
edited by dotnet-policy-service Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Problem

Orleans storage providers need a reusable public contract suite for validating IGrainStorage behavior. The original implementation in #9742 could no longer merge cleanly and its CI autobuild was broken by repository feed changes.

Solution

  • Add the Microsoft.Orleans.Persistence.TestKit package with reusable xUnit storage contract tests and an InProcessTestClusterBuilder fixture.
  • Cover read/write/clear lifecycles, optimistic concurrency, ETags, missing-state reset, key forms, state-name isolation, Cyrillic values, and parallel operations.
  • Exercise the kit against memory and Azure Table storage.
  • Integrate the package, tests, generated API baseline, package README, and current solution layout.

Rationale

A shared suite makes provider behavior consistent and gives third-party provider authors the same contract coverage as Orleans-owned implementations. Provider-specific exception subclasses and both delete-on-clear and tombstone-on-clear semantics remain supported.

Supersedes #9742.

Microsoft Reviewers: Open in CodeFlow

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ReubenBond ReubenBond mentioned this pull request Aug 11, 2026
Add Orleans.Persistence.TestKit package for testing IGrainStorage providers #9742
Closed
9 tasks done
@ReubenBond
ReubenBond force-pushed the rb-fix-pr-9742 branch from 972c5f7 to f607a69 Compare August 11, 2026 17:20
Copilot AI and others added 11 commits August 11, 2026 10:45
@ReubenBond
Initial plan
81bd16a
@ReubenBond
Initial planning for Orleans.Persistence.TestKit package
e399a00
Co-authored-by: ReubenBond <[email protected]>
@ReubenBond
Create Orleans.Persistence.TestKit package with comprehensive test suite
452fee8
Co-authored-by: ReubenBond <[email protected]>
@ReubenBond
Add additional test methods to GrainStorageTestRunner
c6a4a15
Co-authored-by: ReubenBond <[email protected]>
@ReubenBond
Add Azure Table Storage example test using TestKit
fd095d2
Co-authored-by: ReubenBond <[email protected]>
@ReubenBond
Address code review feedback - improve null handling in TestState1
9cbb248
Co-authored-by: ReubenBond <[email protected]>
@ReubenBond
Rename test methods to match base implementation names
3372fc8
Co-authored-by: ReubenBond <[email protected]>
@ReubenBond
Add comprehensive test coverage based on existing IGrainStorage test …
ca30721
…scenarios

Co-authored-by: ReubenBond <[email protected]>
@ReubenBond
Add comprehensive Clear/ETag tests and state null handling tests
f461a79
Co-authored-by: ReubenBond <[email protected]>
@ReubenBond
fix(testing): repair persistence test kit
435bbf8
Rebase the test kit integration onto the current solution layout, restore repository package sources, and make the reusable storage contract tests compile and pass across supported target frameworks.

Co-authored-by: Copilot <[email protected]>
@ReubenBond
fix(testing): support provider-specific storage semantics
8939052
Accept provider-specific inconsistency exception subclasses and both deletion and tombstone ETag behavior when clearing missing state.

Co-authored-by: Copilot App <[email protected]>
@ReubenBond
ReubenBond force-pushed the rb-fix-pr-9742 branch from f607a69 to 8939052 Compare August 11, 2026 17:45
@ReubenBond
fix(testing): keep persistence test kit unpublished
4a67d9c
Require Orleans 10 or later in the package documentation.

Co-authored-by: Copilot App <[email protected]>
Copilot AI lite review requested due to automatic review settings August 12, 2026 15:03
@ReubenBond
ReubenBond marked this pull request as ready for review August 12, 2026 15:04
Copilot started reviewing on behalf of ReubenBond August 12, 2026 15:04
View session
@ReubenBond
ReubenBond merged commit 3b40ddb into dotnet:main Aug 12, 2026
66 of 69 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
ReubenBond deleted the rb-fix-pr-9742 branch August 12, 2026 15:04
Copilot AI reviewed Aug 12, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull request overview

Adds a new reusable test-kit library to Orleans for validating IGrainStorage implementations via a shared xUnit contract suite, plus sample/adopter tests to exercise it against existing providers.

Changes:

  • Introduces Microsoft.Orleans.Persistence.TestKit with an InProcessTestClusterBuilder-based fixture and a base GrainStorageTestRunner contract suite.
  • Adds a new test project demonstrating the kit against MemoryGrainStorage.
  • Integrates the kit into existing Azure Table storage tests and solution/project references (including API baseline).
Show a summary per file
File Description
Orleans.slnx Adds the new test kit project and its tests to the solution.
src/Orleans.Persistence.TestKit/Orleans.Persistence.TestKit.csproj Defines the new public test kit package/project configuration.
src/Orleans.Persistence.TestKit/README.md Documents usage, available tests, and integration patterns for the kit.
src/Orleans.Persistence.TestKit/GrainStorageTestRunner.cs Implements the reusable IGrainStorage contract test suite and helpers.
src/Orleans.Persistence.TestKit/GrainStorageTestFixture.cs Provides an in-proc test cluster fixture to configure and resolve the storage provider under test.
src/Orleans.Persistence.TestKit/TestStates/TestState1.cs Adds a canonical test state type used by the contract suite.
src/api/Orleans.Persistence.TestKit/Orleans.Persistence.TestKit.cs Adds the generated public API baseline for the new package.
test/Orleans.Persistence.TestKit.Tests/Orleans.Persistence.TestKit.Tests.csproj Adds a new test project to validate/demo the kit.
test/Orleans.Persistence.TestKit.Tests/MemoryGrainStorageTests.cs Demonstrates and runs the contract suite against Memory grain storage.
test/Extensions/Orleans.Azure.Tests/Persistence/AzureTableGrainStorageTestKitTests.cs Runs the contract suite against Azure Table grain storage (skippable).
test/Extensions/Orleans.Azure.Tests/Orleans.Azure.Tests.csproj References the new test kit from the Azure test project.

Review details

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

Suppressed comments (1)

src/Orleans.Persistence.TestKit/GrainStorageTestRunner.cs:96

  • Typo in local variable name: "recordExitsAfterClearing" should be "recordExistsAfterClearing".
        var recordExitsAfterClearing = grainState.RecordExists;
        Assert.False(recordExitsAfterClearing);
  • Files reviewed: 11/11 changed files
  • Comments generated: 7
  • Review effort level: Lite

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/Orleans.Persistence.TestKit/Orleans.Persistence.TestKit.csproj
<TargetFrameworks>$(DefaultTargetFrameworks)</TargetFrameworks>
<OrleansBuildTimeCodeGen>true</OrleansBuildTimeCodeGen>
<IsOrleansFrameworkPart>false</IsOrleansFrameworkPart>
<IsPackable>false</IsPackable>
Comment thread src/Orleans.Persistence.TestKit/GrainStorageTestRunner.cs
Comment on lines +70 to +72
Assert.Equal(grainState.ETag, storedGrainState.ETag);
Assert.Equal(grainState.State, storedGrainState.State);
Assert.True(storedGrainState.RecordExists);
Comment thread src/Orleans.Persistence.TestKit/GrainStorageTestRunner.cs
Comment on lines +88 to +89
var recordExitsAfterWriting = grainState.RecordExists;
Assert.True(recordExitsAfterWriting);
Comment thread src/Orleans.Persistence.TestKit/GrainStorageTestRunner.cs
Comment on lines +98 to +101
var storedGrainState = new GrainState<T> { State = new T(), ETag = clearedStateVersion };
await Storage.WriteStateAsync(grainTypeName, grainId, storedGrainState).ConfigureAwait(false);
Assert.Equal(storedGrainState.State, Activator.CreateInstance<T>());
Assert.True(storedGrainState.RecordExists);
Comment thread src/Orleans.Persistence.TestKit/GrainStorageTestRunner.cs
Comment on lines +193 to +199
int StartOfRange = 33900;
int CountOfRange = countOfGrains;

// Since the version is NULL, storage provider tries to insert this data as new state.
// If there is already data with this class, the writing fails and the storage provider throws.
var grainStates = Enumerable.Range(StartOfRange, CountOfRange)
.Select(i => GetTestReferenceAndState($"{prefix}-{Guid.NewGuid():N}-{i}", null))
Comment thread src/Orleans.Persistence.TestKit/GrainStorageTestRunner.cs
Comment on lines +215 to +217
int MaxNumberOfThreads = Environment.ProcessorCount * 3;

await Parallel.ForEachAsync(grainStates, new ParallelOptions { MaxDegreeOfParallelism = MaxNumberOfThreads }, async (grainData, ct) =>
Comment thread src/Orleans.Persistence.TestKit/GrainStorageTestFixture.cs
Comment on lines +102 to +103
var builder = new InProcessTestClusterBuilder();
builder.ConfigureSilo((_, siloBuilder) => ConfigureSilo(siloBuilder));
This was referenced Aug 28, 2026
Bump Microsoft.Orleans.Dashboard from 10.2.2 to 10.3.0 csrakowski/FeedManager#20
Merged
Bump Microsoft.Orleans.Persistence.AdoNet from 10.2.2 to 10.3.0 csrakowski/FeedManager#21
Merged
Bump Microsoft.Orleans.Persistence.Memory from 10.2.2 to 10.3.0 csrakowski/FeedManager#22
Closed
Bump Microsoft.Orleans.Persistence.Redis from 10.2.2 to 10.3.0 csrakowski/FeedManager#23
Merged
Bump Microsoft.Orleans.Runtime from 10.2.2 to 10.3.0 csrakowski/FeedManager#24
Merged
Bump Microsoft.Orleans.Sdk from 10.2.2 to 10.3.0 csrakowski/FeedManager#25
Merged
Bump Microsoft.Orleans.Persistence.Memory and Microsoft.Orleans.Server csrakowski/FeedManager#26
Merged
Bump the dotnet-dependencies group with 1 update dills122/sandtable#67
Merged
Bump the dotnet group with 2 updates Kuestenlogik/Surgewave.Connectors#20
Merged
This was referenced Aug 31, 2026
chore: Bump Microsoft.Orleans.Serialization.Abstractions from 10.2.2 to 10.3.1 managedcode/Communication#154
Merged
chore: Bump Microsoft.Orleans.Persistence.Memory and 3 others managedcode/Communication#155
Closed
chore: Bump Microsoft.Orleans.TestingHost from 10.2.2 to 10.3.1 managedcode/Communication#156
Merged
Bump the orleans group with 1 update vgmello/momentum#341
Closed
Bump Microsoft.Orleans.BroadcastChannel and 5 others intochat/intochat#77
Closed
Bump the orleans group with 10 updates bartul/agave#86
Closed
Bump the orleans group with 3 updates microsoft/aspire-samples#1930
Closed
Bump the nuget-minor-patch group with 21 updates Systemorph/MeshWeaver#3519
Closed
chore(deps): Bump the nuget-patch-and-minor group with 13 updates petesramek/microservices-vs-virtual-actors#8
Closed
This was referenced Sep 7, 2026
Bump the orleans group with 3 updates microsoft/aspire-samples#1931
Merged
Bump the orleans group with 10 updates bartul/agave#87
Merged
Bump the dotnet group with 5 updates dotnet/docs#55908
Merged
Bump the dotnet group with 4 updates dotnet/docs#55909
Merged
Bump the dotnet group with 4 updates dotnet/docs#55910
Merged
Bump the dotnet group with 5 updates dotnet/docs#55911
Merged
Bump the dotnet group with 4 updates IvanMarkitan/dotnet-docs#838
Closed
Bump the dotnet group with 6 updates IvanMarkitan/dotnet-docs#839
Closed
Bump the dotnet group with 7 updates IvanMarkitan/dotnet-docs#840
Closed
Bump Microsoft.Orleans.Sdk and Microsoft.Orleans.Server IvanMarkitan/dotnet-docs#843
Open
Bump Microsoft.Orleans.Clustering.Redis and 4 others IvanMarkitan/dotnet-docs#845
Closed
Bump the dotnet group with 7 updates IvanMarkitan/dotnet-docs#846
Open
Bump the dotnet group with 5 updates BillWagner/docs#9804
Closed
Bump the dotnet group with 4 updates BillWagner/docs#9805
Closed
Bump the dotnet group with 4 updates BillWagner/docs#9806
Closed
Bump the dotnet group with 5 updates BillWagner/docs#9807
Closed
Bump the dotnet group with 7 updates zbalkan/docs#2339
Closed
Bump the dotnet group with 5 updates zbalkan/docs#2340
Closed
Bump the dotnet group with 6 updates zbalkan/docs#2341
Closed
Bump the dotnet group with 10 updates zbalkan/docs#2347
Open
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ReubenBond
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.