Repository navigation
Fix subscription node tests for terminal error result contract - #10284
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Fusion subscription execution node tests to align with the “terminal error result” contract, ensuring failures surface as a final OperationResult (with errors) followed by stream completion, and that memory arenas are disposed/retained correctly across failure scenarios.
Changes:
- Adjusted subscription stream expectations to assert: one terminal error result then end of stream.
- Added inline JSON snapshots and exception assertions for terminal error results.
- Updated arena ownership/disposal assertions for “fails after minting” vs “fails before minting” scenarios.
Suppressed comments (2)
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/OperationExecutionNodeTests.cs:115
enumerator.Currentis captured for bothfirstResultandsecondResultwithout first checkinghasFirstResult/hasSecondResult. If eitherMoveNextAsync()returnsfalse,Currentis undefined and the test may throw before the assertions (and thefinallywill still attempt to dispose results). Assert theMoveNextAsync()outcome before readingCurrent, and remove the redundant asserts from the assert section.
var hasFirstResult = await enumerator.MoveNextAsync();
var firstResult = enumerator.Current;
var mintedArena = client.MintedArenas.Single();
var hasSecondResult = await enumerator.MoveNextAsync();
var secondResult = enumerator.Current;
var hasThirdResult = await enumerator.MoveNextAsync();
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/OperationExecutionNodeTests.cs:124
- This test now has 8
Assert.*calls, which exceeds the repo testing guideline hard limit of 5 asserts per test method (AGENTS.md:51). Consider consolidating the multiple checks (stream progression, error JSON, exception details, and arena state) into a snapshot (Markdown snapshot if multiple shapes) to stay within the limit.
// the delivered event arrives, then one terminal error result, then the stream ends
var firstArena = Assert.IsType<MemoryArena>(mintedArena);
Assert.True(hasFirstResult);
Assert.True(hasSecondResult);
Assert.False(hasThirdResult);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Aug 29, 2026
Merged
This was referenced Sep 8, 2026
Closed
Closed
This was referenced Sep 15, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#405
Closed
Closed
This was referenced Sep 22, 2026
Closed
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#410
Merged
This was referenced Oct 5, 2026
Open
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.
No description provided.