Merge pull request #20158 from jtattermusch/csharp_remove_deadline_workaround

Remove C# workaround for DeadlineExceeded status #2685
pull/20162/head
Jan Tattermusch 5 years ago committed by GitHub
commit 74955f5f61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/csharp/Grpc.Core.Tests/TimeoutsTest.cs
  2. 4
      src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs
  3. 3
      src/csharp/Grpc.IntegrationTesting/InteropClient.cs

@ -96,8 +96,7 @@ namespace Grpc.Core.Tests
});
var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.MinValue)), "abc"));
// We can't guarantee the status code always DeadlineExceeded. See issue #2685.
Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal });
Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode);
}
[Test]
@ -110,8 +109,7 @@ namespace Grpc.Core.Tests
});
var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.UtcNow.Add(TimeSpan.FromSeconds(5)))), "abc"));
// We can't guarantee the status code always DeadlineExceeded. See issue #2685.
Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal });
Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode);
}
[Test]
@ -130,9 +128,7 @@ namespace Grpc.Core.Tests
});
var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.UtcNow.Add(TimeSpan.FromSeconds(5)))), "abc"));
// We can't guarantee the status code always DeadlineExceeded. See issue #2685.
Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal });
Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode);
Assert.IsTrue(await serverReceivedCancellationTcs.Task);
}
}

@ -136,9 +136,7 @@ namespace Math.Tests
deadline: DateTime.UtcNow.AddMilliseconds(500)))
{
var ex = Assert.ThrowsAsync<RpcException>(async () => await call.ResponseStream.ToListAsync());
// We can't guarantee the status code always DeadlineExceeded. See issue #2685.
Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal });
Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode);
}
}

@ -476,8 +476,7 @@ namespace Grpc.IntegrationTesting
}
catch (RpcException ex)
{
// We can't guarantee the status code always DeadlineExceeded. See issue #2685.
Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal });
Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode);
}
}
Console.WriteLine("Passed!");

Loading…
Cancel
Save