Skip to content

Commit

Permalink
Don't enforce global timeout when debugging (Azure#25524)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLove-msft authored Nov 25, 2021
1 parent e38b7d0 commit 5e83d87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdk/core/Azure.Core.TestFramework/src/ClientTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using Castle.DynamicProxy;
using NUnit.Framework;
Expand Down Expand Up @@ -35,7 +36,7 @@ public virtual void GlobalTimeoutTearDown()
{
var executionContext = TestExecutionContext.CurrentContext;
var duration = DateTime.UtcNow - executionContext.StartTime;
if (duration > TimeSpan.FromSeconds(GLOBAL_TEST_TIMEOUT_IN_SECONDS))
if (duration > TimeSpan.FromSeconds(GLOBAL_TEST_TIMEOUT_IN_SECONDS) && !Debugger.IsAttached)
{
executionContext.CurrentResult.SetResult(ResultState.Failure, $"Test exceeded global time limit of {GLOBAL_TEST_TIMEOUT_IN_SECONDS} seconds. Duration: {duration}");
}
Expand Down

0 comments on commit 5e83d87

Please sign in to comment.