Skip to content

Commit 4167ded

Browse files
authored
Shorten default timeout to 5 seconds with a debug build (#32162)
1 parent 4a382c1 commit 4167ded

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Shared/TaskExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ namespace System.Threading.Tasks.Extensions
2222
#endif
2323
static class TaskExtensions
2424
{
25+
#if DEBUG
26+
// Shorter duration when running tests with debug.
27+
// Less time waiting for hang unit tests to fail in aspnetcore solution.
28+
private const int DefaultTimeoutDuration = 5 * 1000;
29+
#else
2530
private const int DefaultTimeoutDuration = 30 * 1000;
31+
#endif
2632

2733
public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration);
2834

0 commit comments

Comments
 (0)