diff --git a/src/DotNext.Tests/Threading/AsyncTriggerTests.cs b/src/DotNext.Tests/Threading/AsyncTriggerTests.cs index 993e7f1d9..49cd74b1d 100644 --- a/src/DotNext.Tests/Threading/AsyncTriggerTests.cs +++ b/src/DotNext.Tests/Threading/AsyncTriggerTests.cs @@ -56,6 +56,22 @@ public static async Task SignalAndWait() await task2; } + + [Fact] + public static async Task SignalAndWaitWithTimeout() + { + using var trigger = new AsyncTrigger(); + + var task1 = trigger.WaitAsync(); + var task2 = trigger.SignalAndWaitAsync(false, true, DefaultTimeout); + + await task1; + False(task2.IsCompleted); + + True(trigger.Signal()); + + True(await task2); + } [Fact] public static async Task SignalEmptyQueue()