test(codegen): pass cancellation token to diagnostics - #10878
Conversation
There was a problem hiding this comment.
Copilot review overview
Review tier: Lite
Findings: None
What changed in this PR
This PR fixes the test project build break caused by xUnit1051 by ensuring Roslyn diagnostic collection in GeneratedWarningSuppressionTests respects xUnit’s cancellation flow, restoring warning-as-error builds without changing test intent.
Changes:
- Passes
TestContext.Current.CancellationTokenintoCSharpCompilation.GetDiagnostics(...)for the obsolete-warning suppression assertions.
| File | Description |
|---|---|
| test/Orleans.CodeGenerator.Tests/GeneratedWarningSuppressionTests.cs | Threads TestContext.Current.CancellationToken into Roslyn diagnostics collection to satisfy xUnit1051 and keep cancellation propagation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
CI restore failures in this run are unrelated to this change: Azure DevOps NuGet feeds are returning HTTP 500 / |
Code coverage78.54% line coverage - 99,430 / 126,605 lines Coverage details
|
|
The Azure DevOps NuGet feed recovered. Failed-job rerun attempt 2 completed successfully: all 75 PR checks now pass. |
Fixes #10856.
Passes
TestContext.Current.CancellationTokento Roslyn diagnostic collection inGeneratedWarningSuppressionTests, satisfying xUnit1051 and restoring warning-as-error builds for the test project.This keeps cancellation flowing through the potentially long-running diagnostic operation without changing the test's assertions or generated-code behavior.
Microsoft Reviewers: Open in CodeFlow