shouldly / shouldly

Should testing for .NET—the way assertions should be!

Home Page:https://docs.shouldly.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should.CompleteIn deadlocks on single threaded synchronization context

rick-palmsens opened this issue · comments

Example:

using Nito.AsyncEx;
using Shouldly;

AsyncContext.Run(() =>
{
    Should.CompleteIn(async () =>
    {
        Console.WriteLine("Starting delay");
        await Task.Delay(100);
        Console.WriteLine("Delay completed");

    }, Timeout.InfiniteTimeSpan);
});

Expected output:

Starting delay
Delay completed

Actual output:

Starting delay