Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubch1 committed Jun 16, 2020
1 parent be9537b commit f157e24
Showing 1 changed file with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -450,21 +450,27 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturnNull_IfOperationCancelle

mockAttachmentHandler1.Setup(h => h.HandleDataCollectionAttachmentSets(It.IsAny<ICollection<AttachmentSet>>(), It.IsAny<CancellationToken>())).Returns((ICollection<AttachmentSet> i1, CancellationToken cancellation) =>
{
for (int i = 0; i < 1000; ++i)
try
{
Task.Delay(100).Wait();
Console.WriteLine($"Iteration: {i}");
for (int i = 0; i < 1000; ++i)
{
Task.Delay(100).Wait();
Console.WriteLine($"Iteration: {i}");

cancellation.ThrowIfCancellationRequested();
cancellation.ThrowIfCancellationRequested();

if (i == 3)
{
cancellationTokenSource.Cancel();
Task.Delay(500).Wait();
if (i == 3)
{
cancellationTokenSource.Cancel();
Task.Delay(500).Wait();
}
}
}
finally
{
innerTaskCompletionSource.TrySetResult(null);
}

innerTaskCompletionSource.TrySetResult(null);
return outputAttachments;
});

Expand Down

0 comments on commit f157e24

Please sign in to comment.