The service executes a set of asynchronous jobs and returns a summary for each run. After a recent change, the behavior became unstable: when individual items fail and when the entire run is canceled, the result no longer matches the method contract.
RunAsync method accepts a sequence of IEnumerable<Func<CancellationToken, Task>>.CancellationToken.CancellationToken, the method must not convert this state into a normal successful result.Completed field must reflect only the number of jobs that finished without an exception.JobBatchRunner.RunAsync a set of several tasks where:
CancellationToken is canceled before the entire list finishes.Example run:
dotnet test
Failed, but does not interrupt the remaining jobs of the current call.CancellationToken must preserve cancellation semantics for the calling code.8.0.204C# 12xUnit testsdotnet testxunit 2.6.6, xunit.runner.visualstudio 2.5.6, Microsoft.NET.Test.Sdk 17.10.0Use line comments to explain the problem, its impact, the fix and how to test it.