修复错误
This commit is contained in:
@@ -533,8 +533,13 @@ internal sealed class SynchronousProgress<T> : IProgress<T>
|
|||||||
.Returns(Task.CompletedTask);
|
.Returns(Task.CompletedTask);
|
||||||
|
|
||||||
using var cts = new CancellationTokenSource();
|
using var cts = new CancellationTokenSource();
|
||||||
// Cancel after 50ms — well before the 5000ms delay completes
|
// Cancel after BeginRunAsync is called — ensures execution has started
|
||||||
cts.CancelAfter(50);
|
// but cancellation fires well before the 5000ms WaitDelay completes
|
||||||
|
mockStore.Setup(s => s.BeginRunAsync(
|
||||||
|
It.IsAny<InspectionRunRecord>(),
|
||||||
|
It.IsAny<InspectionAssetWriteRequest>()))
|
||||||
|
.Callback<InspectionRunRecord, InspectionAssetWriteRequest>((_, __) => cts.CancelAfter(50))
|
||||||
|
.Returns(Task.CompletedTask);
|
||||||
|
|
||||||
await service.ExecuteAsync(program, null, cts.Token);
|
await service.ExecuteAsync(program, null, cts.Token);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user