Improved diagnostic output for hunting the mysterious spuriously failing TcpRpcStress.Embargo test

This commit is contained in:
Christian Köllner 2019-12-29 23:03:14 +01:00
parent 713f354980
commit f58185df4d
2 changed files with 3 additions and 3 deletions

View File

@ -482,7 +482,7 @@ namespace Capnp.Net.Runtime.Tests
bool flag = call0.Wait(MediumNonDbgTimeout);
Assert.IsTrue(flag);
}
catch (RpcException exception) when (exception.Message == "Cannot access a disposed object.")
catch (AggregateException exception) when (exception.InnerException is RpcException rpcException && rpcException.Message == "Cannot access a disposed object.")
{
Logger.Log(LogLevel.Information, $"Oops, object disposed. Counter = {cap.Count}, tx count = {client.SendCount}, rx count = {client.RecvCount}");
throw;

View File

@ -72,7 +72,7 @@ namespace Capnp.Rpc
{
--_refCount;
throw new ObjectDisposedException(nameof(ConsumedCapability));
throw new ObjectDisposedException(ToString(), "Attempted to add reference to capability which was already released");
}
}
}
@ -106,7 +106,7 @@ namespace Capnp.Rpc
{
if (_refCount <= 0)
{
throw new ObjectDisposedException(nameof(ConsumedCapability), "Validation failed, capability is already disposed");
throw new ObjectDisposedException(ToString(), "Validation failed, capability is already disposed");
}
}
}