Skip to content

Commit

Permalink
Adding better error on timeout.
Browse files Browse the repository at this point in the history
Increasing timeout
  • Loading branch information
ayende committed Jul 9, 2015
1 parent 509edcc commit 2087898
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Raven.Abstractions/Util/AsyncHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -55,6 +56,7 @@ public static void RunSync(Func<Task> task)
public static T RunSync<T>(Func<Task<T>> task)
{
var result = default(T);
Stopwatch sp = Stopwatch.StartNew();
var oldContext = SynchronizationContext.Current;
try
{
Expand All @@ -74,6 +76,7 @@ public static T RunSync<T>(Func<Task<T>> task)
}
finally
{
sp.Stop();
synch.EndMessageLoop();
}
}, null);
Expand All @@ -82,6 +85,8 @@ public static T RunSync<T>(Func<Task<T>> task)
catch (AggregateException ex)
{
var exception = ex.ExtractSingleInnerException();
if (exception is OperationCanceledException)
throw new TimeoutException("Operation timed out after: " + sp.Elapsed, ex);
ExceptionDispatchInfo.Capture(exception).Throw();
}
finally
Expand Down
2 changes: 1 addition & 1 deletion Raven.SlowTests/Bugs/VeryBigResultSetRemote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void CanGetVeryBigResultSetsEvenThoughItIsBadForYou()
using (var server = GetNewServer())
using (var store = new DocumentStore { Url = "http://localhost:8079" }.Initialize())
{
store.SetRequestsTimeoutFor(TimeSpan.FromMinutes(1));
store.SetRequestsTimeoutFor(TimeSpan.FromMinutes(3));
using (var session = store.OpenSession())
{
for (int i = 0; i < 15000; i++)
Expand Down

0 comments on commit 2087898

Please sign in to comment.