Skip to content

Commit

Permalink
Extends timeout duration
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuki committed Dec 16, 2024
1 parent 61fd1e4 commit efc15d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/YetAnotherHttpHandler.Test/StressTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace _YetAnotherHttpHandler.Test;

public class StressTest : UseTestServerTestBase
{
protected override TimeSpan UnexpectedTimeout => TimeSpan.FromMinutes(3);
protected override TimeSpan UnexpectedTimeout => TimeSpan.FromMinutes(5);

public StressTest(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
Expand Down
2 changes: 2 additions & 0 deletions test/YetAnotherHttpHandler.Test/TimeoutTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ public abstract class TimeoutTestBase
protected CancellationToken TimeoutToken => Debugger.IsAttached ? CancellationToken.None : _timeoutTokenSource.Token;

protected virtual TimeSpan UnexpectedTimeout => Debugger.IsAttached ? Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(10);
protected DateTimeOffset UnexpectedTimeoutOn { get; }


protected TimeoutTestBase()
{
_timeoutTokenSource = new CancellationTokenSource(UnexpectedTimeout);
UnexpectedTimeoutOn = DateTimeOffset.UtcNow.Add(UnexpectedTimeout);
}
}
1 change: 1 addition & 0 deletions test/YetAnotherHttpHandler.Test/UseTestServerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public abstract class UseTestServerTestBase : TimeoutTestBase, IDisposable
protected UseTestServerTestBase(ITestOutputHelper testOutputHelper)
{
TestOutputHelper = testOutputHelper ?? throw new ArgumentNullException(nameof(testOutputHelper));
testOutputHelper.WriteLine($"[{DateTime.Now}][{nameof(TimeoutTestBase)}] UnexpectedTimeout = {UnexpectedTimeout} ({UnexpectedTimeoutOn})");
_tokenRegistration = TimeoutToken.Register(() =>
{
testOutputHelper.WriteLine($"[{DateTime.Now}][{nameof(TimeoutTestBase)}] Timeout reached");
Expand Down

0 comments on commit efc15d7

Please sign in to comment.