diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c6aa6834..a62da8261 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,10 @@ All notable changes to **bUnit** will be documented in this file. The project ad ## [Unreleased] - ### Added - `net8.0` support +- Increased timeout of `WaitForAssertion` to infinite when a debugger is attached. By [@linkdotnet](https://github.com/linkdotnet). ## [1.22.19] - 2023-07-28 diff --git a/src/bunit.core/Extensions/WaitForHelpers/WaitForHelper.cs b/src/bunit.core/Extensions/WaitForHelpers/WaitForHelper.cs index f237f419b..e1bc8bb0c 100644 --- a/src/bunit.core/Extensions/WaitForHelpers/WaitForHelper.cs +++ b/src/bunit.core/Extensions/WaitForHelpers/WaitForHelper.cs @@ -1,3 +1,4 @@ +using System.Diagnostics; using Bunit.Rendering; using Microsoft.Extensions.Logging; @@ -194,6 +195,9 @@ private void SubscribeToOnAfterRender() private static TimeSpan GetRuntimeTimeout(TimeSpan? timeout) { - return timeout ?? TestContextBase.DefaultWaitTimeout; + var defaultWaitTimeout = Debugger.IsAttached + ? Timeout.InfiniteTimeSpan + : TestContextBase.DefaultWaitTimeout; + return timeout ?? defaultWaitTimeout; } }