diff --git a/examples/csharp/helloworld-from-cli/global.json b/examples/csharp/helloworld-from-cli/global.json new file mode 100644 index 00000000000..e4b797ee8ef --- /dev/null +++ b/examples/csharp/helloworld-from-cli/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "1.0.0" + } +} diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index ab4a8a6aa3d..bc3b0f24cdd 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -670,6 +670,7 @@ grpc::string GetServices(const FileDescriptor *file, bool generate_client, out.Print(leading_comments.c_str()); } + out.Print("#pragma warning disable 1591\n"); out.Print("#region Designer generated code\n"); out.Print("\n"); out.Print("using System;\n"); diff --git a/src/csharp/Grpc.Auth/Grpc.Auth.csproj b/src/csharp/Grpc.Auth/Grpc.Auth.csproj index 6030c707830..abf326459c1 100755 --- a/src/csharp/Grpc.Auth/Grpc.Auth.csproj +++ b/src/csharp/Grpc.Auth/Grpc.Auth.csproj @@ -19,6 +19,7 @@ true true true + true diff --git a/src/csharp/Grpc.Core.Testing/Grpc.Core.Testing.csproj b/src/csharp/Grpc.Core.Testing/Grpc.Core.Testing.csproj index 4e186d14dc9..9ad6fd0c616 100755 --- a/src/csharp/Grpc.Core.Testing/Grpc.Core.Testing.csproj +++ b/src/csharp/Grpc.Core.Testing/Grpc.Core.Testing.csproj @@ -19,6 +19,7 @@ true true true + true diff --git a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs index 0cb9288131d..72d9035a6ff 100644 --- a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs @@ -57,9 +57,9 @@ namespace Grpc.Core.Tests [Test] public async Task UnaryCall() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { - return request; + return Task.FromResult(request); }); Assert.AreEqual("ABC", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "ABC")); @@ -124,10 +124,10 @@ namespace Grpc.Core.Tests [Test] public void UnaryCall_ServerHandlerSetsStatus() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { context.Status = new Status(StatusCode.Unauthenticated, ""); - return ""; + return Task.FromResult(""); }); var ex = Assert.Throws(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); @@ -142,11 +142,11 @@ namespace Grpc.Core.Tests [Test] public void UnaryCall_ServerHandlerSetsStatusAndTrailers() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { context.Status = new Status(StatusCode.Unauthenticated, ""); context.ResponseTrailers.Add("xyz", "xyz-value"); - return ""; + return Task.FromResult(""); }); var ex = Assert.Throws(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); @@ -168,9 +168,10 @@ namespace Grpc.Core.Tests helper.ClientStreamingHandler = new ClientStreamingServerMethod(async (requestStream, context) => { string result = ""; - await requestStream.ForEachAsync(async (request) => + await requestStream.ForEachAsync((request) => { result += request; + return TaskUtils.CompletedTask; }); await Task.Delay(100); return result; @@ -203,9 +204,7 @@ namespace Grpc.Core.Tests [Test] public async Task ServerStreamingCall_EndOfStreamIsIdempotent() { - helper.ServerStreamingHandler = new ServerStreamingServerMethod(async (request, responseStream, context) => - { - }); + helper.ServerStreamingHandler = new ServerStreamingServerMethod((request, responseStream, context) => TaskUtils.CompletedTask); var call = Calls.AsyncServerStreamingCall(helper.CreateServerStreamingCall(), ""); @@ -214,11 +213,12 @@ namespace Grpc.Core.Tests } [Test] - public async Task ServerStreamingCall_ErrorCanBeAwaitedTwice() + public void ServerStreamingCall_ErrorCanBeAwaitedTwice() { - helper.ServerStreamingHandler = new ServerStreamingServerMethod(async (request, responseStream, context) => + helper.ServerStreamingHandler = new ServerStreamingServerMethod((request, responseStream, context) => { context.Status = new Status(StatusCode.InvalidArgument, ""); + return TaskUtils.CompletedTask; }); var call = Calls.AsyncServerStreamingCall(helper.CreateServerStreamingCall(), ""); @@ -232,9 +232,9 @@ namespace Grpc.Core.Tests } [Test] - public async Task ServerStreamingCall_TrailersFromMultipleSourcesGetConcatenated() + public void ServerStreamingCall_TrailersFromMultipleSourcesGetConcatenated() { - helper.ServerStreamingHandler = new ServerStreamingServerMethod(async (request, responseStream, context) => + helper.ServerStreamingHandler = new ServerStreamingServerMethod((request, responseStream, context) => { context.ResponseTrailers.Add("xyz", "xyz-value"); throw new RpcException(new Status(StatusCode.InvalidArgument, ""), new Metadata { {"abc", "abc-value"} }); @@ -343,7 +343,7 @@ namespace Grpc.Core.Tests [Test] public async Task AsyncUnaryCall_EchoMetadata() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { foreach (Metadata.Entry metadataEntry in context.RequestHeaders) { @@ -352,7 +352,7 @@ namespace Grpc.Core.Tests context.ResponseTrailers.Add(metadataEntry); } } - return ""; + return Task.FromResult(""); }); var headers = new Metadata @@ -395,10 +395,10 @@ namespace Grpc.Core.Tests { // some japanese and chinese characters var nonAsciiString = "\u30a1\u30a2\u30a3 \u62b5\u6297\u662f\u5f92\u52b3\u7684"; - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { context.Status = new Status(StatusCode.Unknown, nonAsciiString); - return ""; + return Task.FromResult(""); }); var ex = Assert.Throws(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); @@ -409,9 +409,9 @@ namespace Grpc.Core.Tests [Test] public void ServerCallContext_PeerInfoPresent() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { - return context.Peer; + return Task.FromResult(context.Peer); }); string peer = Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc"); @@ -421,11 +421,11 @@ namespace Grpc.Core.Tests [Test] public void ServerCallContext_HostAndMethodPresent() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { Assert.IsTrue(context.Host.Contains(Host)); Assert.AreEqual("/tests.Test/Unary", context.Method); - return "PASS"; + return Task.FromResult("PASS"); }); Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); } @@ -433,11 +433,11 @@ namespace Grpc.Core.Tests [Test] public void ServerCallContext_AuthContextNotPopulated() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { Assert.IsFalse(context.AuthContext.IsPeerAuthenticated); Assert.AreEqual(0, context.AuthContext.Properties.Count()); - return "PASS"; + return Task.FromResult("PASS"); }); Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); } @@ -445,9 +445,9 @@ namespace Grpc.Core.Tests [Test] public async Task Channel_WaitForStateChangedAsync() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { - return request; + return Task.FromResult(request); }); Assert.ThrowsAsync(typeof(TaskCanceledException), diff --git a/src/csharp/Grpc.Core.Tests/CompressionTest.cs b/src/csharp/Grpc.Core.Tests/CompressionTest.cs index 0b28433b981..9254cb998dc 100644 --- a/src/csharp/Grpc.Core.Tests/CompressionTest.cs +++ b/src/csharp/Grpc.Core.Tests/CompressionTest.cs @@ -55,10 +55,10 @@ namespace Grpc.Core.Tests [Test] public void WriteOptions_Unary() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { context.WriteOptions = new WriteOptions(WriteFlags.NoCompress); - return request; + return Task.FromResult(request); }); var callOptions = new CallOptions(writeOptions: new WriteOptions(WriteFlags.NoCompress)); diff --git a/src/csharp/Grpc.Core.Tests/ContextPropagationTest.cs b/src/csharp/Grpc.Core.Tests/ContextPropagationTest.cs index 5a55ad1bbb2..c8bc372202d 100644 --- a/src/csharp/Grpc.Core.Tests/ContextPropagationTest.cs +++ b/src/csharp/Grpc.Core.Tests/ContextPropagationTest.cs @@ -106,11 +106,11 @@ namespace Grpc.Core.Tests public async Task PropagateDeadline() { var deadline = DateTime.UtcNow.AddDays(7); - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { Assert.IsTrue(context.Deadline < deadline.AddMinutes(1)); Assert.IsTrue(context.Deadline > deadline.AddMinutes(-1)); - return "PASS"; + return Task.FromResult("PASS"); }); helper.ClientStreamingHandler = new ClientStreamingServerMethod(async (requestStream, context) => @@ -135,10 +135,10 @@ namespace Grpc.Core.Tests [Test] public async Task SuppressDeadlinePropagation() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { Assert.AreEqual(DateTime.MaxValue, context.Deadline); - return "PASS"; + return Task.FromResult("PASS"); }); helper.ClientStreamingHandler = new ClientStreamingServerMethod(async (requestStream, context) => diff --git a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj index 9be77c8875d..6df68fda589 100755 --- a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj +++ b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj @@ -10,6 +10,7 @@ Grpc.Core.Tests $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.Core.Tests/HalfcloseTest.cs b/src/csharp/Grpc.Core.Tests/HalfcloseTest.cs index 02554dcea50..5fc8fb694ab 100644 --- a/src/csharp/Grpc.Core.Tests/HalfcloseTest.cs +++ b/src/csharp/Grpc.Core.Tests/HalfcloseTest.cs @@ -62,9 +62,9 @@ namespace Grpc.Core.Tests [Test] public async Task HalfcloseAfterFullclose_ClientStreamingCall() { - helper.ClientStreamingHandler = new ClientStreamingServerMethod(async (requestStream, context) => + helper.ClientStreamingHandler = new ClientStreamingServerMethod((requestStream, context) => { - return "PASS"; + return Task.FromResult("PASS"); }); var call = Calls.AsyncClientStreamingCall(helper.CreateClientStreamingCall()); diff --git a/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs b/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs index 6dac2de0715..259520846f0 100644 --- a/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs +++ b/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs @@ -29,9 +29,12 @@ namespace Grpc.Core.Internal.Tests public class CompletionQueueEventTest { [Test] - public void CreateAndDestroy() + public void CompletionQueueEventSizeIsNativeSize() { + #pragma warning disable 0618 + // We need to use the obsolete non-generic version of Marshal.SizeOf because the generic version is not available in net45 Assert.AreEqual(CompletionQueueEvent.NativeSize, Marshal.SizeOf(typeof(CompletionQueueEvent))); + #pragma warning restore 0618 } } } diff --git a/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs b/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs index d368c795d92..be35f31c367 100644 --- a/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs +++ b/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs @@ -60,7 +60,10 @@ namespace Grpc.Core.Internal.Tests [Test] public void TimespecSizeIsNativeSize() { + #pragma warning disable 0618 + // We need to use the obsolete non-generic version of Marshal.SizeOf because the generic version is not available in net45 Assert.AreEqual(Timespec.NativeSize, Marshal.SizeOf(typeof(Timespec))); + #pragma warning restore 0618 } [Test] diff --git a/src/csharp/Grpc.Core.Tests/MockServiceHelper.cs b/src/csharp/Grpc.Core.Tests/MockServiceHelper.cs index 925fb20833a..7f4677d57fb 100644 --- a/src/csharp/Grpc.Core.Tests/MockServiceHelper.cs +++ b/src/csharp/Grpc.Core.Tests/MockServiceHelper.cs @@ -96,26 +96,28 @@ namespace Grpc.Core.Tests var defaultStatus = new Status(StatusCode.Unknown, "Default mock implementation. Please provide your own."); - unaryHandler = new UnaryServerMethod(async (request, context) => + unaryHandler = new UnaryServerMethod((request, context) => { context.Status = defaultStatus; - return ""; + return Task.FromResult(""); }); - clientStreamingHandler = new ClientStreamingServerMethod(async (requestStream, context) => + clientStreamingHandler = new ClientStreamingServerMethod((requestStream, context) => { context.Status = defaultStatus; - return ""; + return Task.FromResult(""); }); - serverStreamingHandler = new ServerStreamingServerMethod(async (request, responseStream, context) => + serverStreamingHandler = new ServerStreamingServerMethod((request, responseStream, context) => { context.Status = defaultStatus; + return TaskUtils.CompletedTask; }); - duplexStreamingHandler = new DuplexStreamingServerMethod(async (requestStream, responseStream, context) => + duplexStreamingHandler = new DuplexStreamingServerMethod((requestStream, responseStream, context) => { context.Status = defaultStatus; + return TaskUtils.CompletedTask; }); } diff --git a/src/csharp/Grpc.Core.Tests/PerformanceTest.cs b/src/csharp/Grpc.Core.Tests/PerformanceTest.cs index 2420b47a877..4b1d745284a 100644 --- a/src/csharp/Grpc.Core.Tests/PerformanceTest.cs +++ b/src/csharp/Grpc.Core.Tests/PerformanceTest.cs @@ -61,9 +61,9 @@ namespace Grpc.Core.Tests var profiler = new BasicProfiler(); Profilers.SetForCurrentThread(profiler); - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { - return request; + return Task.FromResult(request); }); var callDetails = helper.CreateUnaryCall(); diff --git a/src/csharp/Grpc.Core.Tests/ResponseHeadersTest.cs b/src/csharp/Grpc.Core.Tests/ResponseHeadersTest.cs index 67dbcf8f09d..e318ee44f4f 100644 --- a/src/csharp/Grpc.Core.Tests/ResponseHeadersTest.cs +++ b/src/csharp/Grpc.Core.Tests/ResponseHeadersTest.cs @@ -138,10 +138,10 @@ namespace Grpc.Core.Tests [Test] public void WriteResponseHeaders_NullNotAllowed() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { Assert.ThrowsAsync(typeof(ArgumentNullException), async () => await context.WriteResponseHeadersAsync(null)); - return "PASS"; + return Task.FromResult("PASS"); }); Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "")); @@ -158,7 +158,7 @@ namespace Grpc.Core.Tests await context.WriteResponseHeadersAsync(headers); Assert.Fail(); } - catch (InvalidOperationException expected) + catch (InvalidOperationException) { } return "PASS"; @@ -178,7 +178,7 @@ namespace Grpc.Core.Tests await context.WriteResponseHeadersAsync(headers); Assert.Fail(); } - catch (InvalidOperationException expected) + catch (InvalidOperationException) { } await responseStream.WriteAsync("B"); diff --git a/src/csharp/Grpc.Core.Tests/ThreadingModelTest.cs b/src/csharp/Grpc.Core.Tests/ThreadingModelTest.cs index fb181989455..9a828f307e2 100644 --- a/src/csharp/Grpc.Core.Tests/ThreadingModelTest.cs +++ b/src/csharp/Grpc.Core.Tests/ThreadingModelTest.cs @@ -50,13 +50,14 @@ namespace Grpc.Core.Tests [Test] public void BlockingCallInServerHandlerDoesNotDeadlock() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { int recursionDepth = int.Parse(request); if (recursionDepth <= 0) { - return "SUCCESS"; + return Task.FromResult("SUCCESS"); } - return Calls.BlockingUnaryCall(helper.CreateUnaryCall(), (recursionDepth - 1).ToString()); + var response = Calls.BlockingUnaryCall(helper.CreateUnaryCall(), (recursionDepth - 1).ToString()); + return Task.FromResult(response); }); int maxRecursionDepth = Environment.ProcessorCount * 2; // make sure we have more pending blocking calls than threads in GrpcThreadPool @@ -66,12 +67,12 @@ namespace Grpc.Core.Tests [Test] public void HandlerDoesNotRunOnGrpcThread() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { if (IsRunningOnGrpcThreadPool()) { - return "Server handler should not run on gRPC threadpool thread."; + return Task.FromResult("Server handler should not run on gRPC threadpool thread."); } - return request; + return Task.FromResult(request); }); Assert.AreEqual("ABC", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "ABC")); @@ -80,9 +81,9 @@ namespace Grpc.Core.Tests [Test] public async Task ContinuationDoesNotRunOnGrpcThread() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { - return request; + return Task.FromResult(request); }); await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "ABC"); diff --git a/src/csharp/Grpc.Core.Tests/TimeoutsTest.cs b/src/csharp/Grpc.Core.Tests/TimeoutsTest.cs index 8f0d6b866d9..b89c1afcc35 100644 --- a/src/csharp/Grpc.Core.Tests/TimeoutsTest.cs +++ b/src/csharp/Grpc.Core.Tests/TimeoutsTest.cs @@ -57,10 +57,10 @@ namespace Grpc.Core.Tests [Test] public void InfiniteDeadline() { - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { Assert.AreEqual(DateTime.MaxValue, context.Deadline); - return "PASS"; + return Task.FromResult("PASS"); }); // no deadline specified, check server sees infinite deadline @@ -75,13 +75,13 @@ namespace Grpc.Core.Tests { var clientDeadline = DateTime.UtcNow + TimeSpan.FromDays(7); - helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + helper.UnaryHandler = new UnaryServerMethod((request, context) => { // A fairly relaxed check that the deadline set by client and deadline seen by server // are in agreement. C core takes care of the work with transferring deadline over the wire, // so we don't need an exact check here. Assert.IsTrue(Math.Abs((clientDeadline - context.Deadline).TotalMilliseconds) < 5000); - return "PASS"; + return Task.FromResult("PASS"); }); Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: clientDeadline)), "abc"); } diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj index e32711c5204..dde800aaddb 100755 --- a/src/csharp/Grpc.Core/Grpc.Core.csproj +++ b/src/csharp/Grpc.Core/Grpc.Core.csproj @@ -18,6 +18,7 @@ true true true + true diff --git a/src/csharp/Grpc.Core/Internal/AuthContextSafeHandle.cs b/src/csharp/Grpc.Core/Internal/AuthContextSafeHandle.cs index 6c22bd59bad..e8e61ebf3c8 100644 --- a/src/csharp/Grpc.Core/Internal/AuthContextSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/AuthContextSafeHandle.cs @@ -74,7 +74,10 @@ namespace Grpc.Core.Internal private AuthProperty PtrToAuthProperty(IntPtr authPropertyPtr) { + #pragma warning disable 0618 + // We need to use the obsolete non-generic version of Marshal.PtrToStructure, because the generic version is not available in net45 var nativeAuthProperty = (NativeAuthProperty) Marshal.PtrToStructure(authPropertyPtr, typeof(NativeAuthProperty)); + #pragma warning restore 0618 var name = Marshal.PtrToStringAnsi(nativeAuthProperty.Name); var valueBytes = new byte[(int) nativeAuthProperty.ValueLength]; Marshal.Copy(nativeAuthProperty.Value, valueBytes, 0, (int)nativeAuthProperty.ValueLength); diff --git a/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj b/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj index 08df026a53a..74deed65840 100755 --- a/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj +++ b/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj @@ -9,6 +9,7 @@ Exe Grpc.Examples.MathClient 1.0.4 + true diff --git a/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj b/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj index a02937474a1..1abf2614985 100755 --- a/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj +++ b/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj @@ -9,6 +9,7 @@ Exe Grpc.Examples.MathServer 1.0.4 + true diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index 9a8e62cc8be..d2a13ed6e14 100755 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -10,6 +10,7 @@ Grpc.Examples.Tests $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs index 8e6d685e0fd..ded80ffba5f 100644 --- a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs +++ b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs @@ -37,7 +37,7 @@ namespace Math.Tests Channel channel; Math.MathClient client; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755 @@ -51,7 +51,7 @@ namespace Math.Tests client = new Math.MathClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); @@ -130,7 +130,7 @@ namespace Math.Tests } [Test] - public async Task FibWithDeadline() + public void FibWithDeadline() { using (var call = client.Fib(new FibArgs { Limit = 0 }, deadline: DateTime.UtcNow.AddMilliseconds(500))) diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index 625c1723bc8..491d313f178 100755 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -8,6 +8,7 @@ Grpc.Examples Grpc.Examples 1.0.4 + true diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 317eeb52efe..4ed414400dc 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -15,6 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // +#pragma warning disable 1591 #region Designer generated code using System; diff --git a/src/csharp/Grpc.Examples/MathServiceImpl.cs b/src/csharp/Grpc.Examples/MathServiceImpl.cs index 85b5e2dd96b..0cc1b791372 100644 --- a/src/csharp/Grpc.Examples/MathServiceImpl.cs +++ b/src/csharp/Grpc.Examples/MathServiceImpl.cs @@ -52,9 +52,10 @@ namespace Math public override async Task Sum(IAsyncStreamReader requestStream, ServerCallContext context) { long sum = 0; - await requestStream.ForEachAsync(async num => + await requestStream.ForEachAsync(num => { sum += num.Num_; + return TaskUtils.CompletedTask; }); return new Num { Num_ = sum }; } diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index b0e2716e7e5..2ccf46b9b9c 100755 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -10,6 +10,7 @@ Grpc.HealthCheck.Tests $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs b/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs index 7dadba75ffc..45e8ad90623 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs +++ b/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs @@ -37,7 +37,7 @@ namespace Grpc.HealthCheck.Tests Grpc.Health.V1.Health.HealthClient client; Grpc.HealthCheck.HealthServiceImpl serviceImpl; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { serviceImpl = new HealthServiceImpl(); @@ -54,7 +54,7 @@ namespace Grpc.HealthCheck.Tests client = new Grpc.Health.V1.Health.HealthClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj index b54311bbd56..3eb90434f3f 100755 --- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj +++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj @@ -18,6 +18,7 @@ true true true + true diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index 8c747aa3060..3e8eb346895 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -15,6 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // +#pragma warning disable 1591 #region Designer generated code using System; diff --git a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj index dcb24c72166..c67beea7cd3 100755 --- a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj +++ b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj @@ -10,6 +10,7 @@ Grpc.IntegrationTesting.Client $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj b/src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj index 43772020d6f..e452257b1b1 100755 --- a/src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj +++ b/src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj @@ -11,6 +11,7 @@ true $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj index db736baed05..a1fb316fdb1 100755 --- a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj +++ b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj @@ -10,6 +10,7 @@ Grpc.IntegrationTesting.Server $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.IntegrationTesting.StressClient/Grpc.IntegrationTesting.StressClient.csproj b/src/csharp/Grpc.IntegrationTesting.StressClient/Grpc.IntegrationTesting.StressClient.csproj index fe4e0da4171..f64bea3d2be 100755 --- a/src/csharp/Grpc.IntegrationTesting.StressClient/Grpc.IntegrationTesting.StressClient.csproj +++ b/src/csharp/Grpc.IntegrationTesting.StressClient/Grpc.IntegrationTesting.StressClient.csproj @@ -10,6 +10,7 @@ Grpc.IntegrationTesting.StressClient $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.IntegrationTesting/Control.cs b/src/csharp/Grpc.IntegrationTesting/Control.cs index d62b5a1c5b4..b15da8b8e51 100644 --- a/src/csharp/Grpc.IntegrationTesting/Control.cs +++ b/src/csharp/Grpc.IntegrationTesting/Control.cs @@ -28,86 +28,89 @@ namespace Grpc.Testing { "c29uUGFyYW1zEhQKDG9mZmVyZWRfbG9hZBgBIAEoASISChBDbG9zZWRMb29w", "UGFyYW1zInsKCkxvYWRQYXJhbXMSNQoLY2xvc2VkX2xvb3AYASABKAsyHi5n", "cnBjLnRlc3RpbmcuQ2xvc2VkTG9vcFBhcmFtc0gAEi4KB3BvaXNzb24YAiAB", - "KAsyGy5ncnBjLnRlc3RpbmcuUG9pc3NvblBhcmFtc0gAQgYKBGxvYWQiQwoO", + "KAsyGy5ncnBjLnRlc3RpbmcuUG9pc3NvblBhcmFtc0gAQgYKBGxvYWQiVgoO", "U2VjdXJpdHlQYXJhbXMSEwoLdXNlX3Rlc3RfY2EYASABKAgSHAoUc2VydmVy", - "X2hvc3Rfb3ZlcnJpZGUYAiABKAkiTQoKQ2hhbm5lbEFyZxIMCgRuYW1lGAEg", - "ASgJEhMKCXN0cl92YWx1ZRgCIAEoCUgAEhMKCWludF92YWx1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yGS5ncnBjLnRlc3RpbmcuQ2xpZW50", + "U3RhdHMSLwoMc2VydmVyX3N0YXRzGAQgAygLMhkuZ3JwYy50ZXN0aW5nLlNl", + "cnZlclN0YXRzEhQKDHNlcnZlcl9jb3JlcxgFIAMoBRI0CgdzdW1tYXJ5GAYg", + "ASgLMiMuZ3JwYy50ZXN0aW5nLlNjZW5hcmlvUmVzdWx0U3VtbWFyeRIWCg5j", + "bGllbnRfc3VjY2VzcxgHIAMoCBIWCg5zZXJ2ZXJfc3VjY2VzcxgIIAMoCBI5", + "Cg9yZXF1ZXN0X3Jlc3VsdHMYCSADKAsyIC5ncnBjLnRlc3RpbmcuUmVxdWVz", + "dFJlc3VsdENvdW50KkEKCkNsaWVudFR5cGUSDwoLU1lOQ19DTElFTlQQABIQ", + "CgxBU1lOQ19DTElFTlQQARIQCgxPVEhFUl9DTElFTlQQAipbCgpTZXJ2ZXJU", + "eXBlEg8KC1NZTkNfU0VSVkVSEAASEAoMQVNZTkNfU0VSVkVSEAESGAoUQVNZ", + "TkNfR0VORVJJQ19TRVJWRVIQAhIQCgxPVEhFUl9TRVJWRVIQAypyCgdScGNU", + "eXBlEgkKBVVOQVJZEAASDQoJU1RSRUFNSU5HEAESGQoVU1RSRUFNSU5HX0ZS", + "T01fQ0xJRU5UEAISGQoVU1RSRUFNSU5HX0ZST01fU0VSVkVSEAMSFwoTU1RS", + "RUFNSU5HX0JPVEhfV0FZUxAEYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Grpc.Testing.PayloadsReflection.Descriptor, global::Grpc.Testing.StatsReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.ClientType), typeof(global::Grpc.Testing.ServerType), typeof(global::Grpc.Testing.RpcType), }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.PoissonParams), global::Grpc.Testing.PoissonParams.Parser, new[]{ "OfferedLoad" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClosedLoopParams), global::Grpc.Testing.ClosedLoopParams.Parser, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.LoadParams), global::Grpc.Testing.LoadParams.Parser, new[]{ "ClosedLoop", "Poisson" }, new[]{ "Load" }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SecurityParams), global::Grpc.Testing.SecurityParams.Parser, new[]{ "UseTestCa", "ServerHostOverride" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SecurityParams), global::Grpc.Testing.SecurityParams.Parser, new[]{ "UseTestCa", "ServerHostOverride", "CredType" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ChannelArg), global::Grpc.Testing.ChannelArg.Parser, new[]{ "Name", "StrValue", "IntValue" }, new[]{ "Value" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientConfig), global::Grpc.Testing.ClientConfig.Parser, new[]{ "ServerTargets", "ClientType", "SecurityParams", "OutstandingRpcsPerChannel", "ClientChannels", "AsyncClientThreads", "RpcType", "LoadParams", "PayloadConfig", "HistogramParams", "CoreList", "CoreLimit", "OtherClientApi", "ChannelArgs", "ThreadsPerCq", "MessagesPerStream" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientStatus), global::Grpc.Testing.ClientStatus.Parser, new[]{ "Stats" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Mark), global::Grpc.Testing.Mark.Parser, new[]{ "Reset" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientArgs), global::Grpc.Testing.ClientArgs.Parser, new[]{ "Setup", "Mark" }, new[]{ "Argtype" }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ServerConfig), global::Grpc.Testing.ServerConfig.Parser, new[]{ "ServerType", "SecurityParams", "Port", "AsyncServerThreads", "CoreLimit", "PayloadConfig", "CoreList", "OtherServerApi", "ThreadsPerCq", "ResourceQuotaSize" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ServerConfig), global::Grpc.Testing.ServerConfig.Parser, new[]{ "ServerType", "SecurityParams", "Port", "AsyncServerThreads", "CoreLimit", "PayloadConfig", "CoreList", "OtherServerApi", "ThreadsPerCq", "ResourceQuotaSize", "ChannelArgs" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ServerArgs), global::Grpc.Testing.ServerArgs.Parser, new[]{ "Setup", "Mark" }, new[]{ "Argtype" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ServerStatus), global::Grpc.Testing.ServerStatus.Parser, new[]{ "Stats", "Port", "Cores" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.CoreRequest), global::Grpc.Testing.CoreRequest.Parser, null, null, null, null), @@ -115,7 +118,7 @@ namespace Grpc.Testing { new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Void), global::Grpc.Testing.Void.Parser, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Scenario), global::Grpc.Testing.Scenario.Parser, new[]{ "Name", "ClientConfig", "NumClients", "ServerConfig", "NumServers", "WarmupSeconds", "BenchmarkSeconds", "SpawnLocalWorkerCount" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Scenarios), global::Grpc.Testing.Scenarios.Parser, new[]{ "Scenarios_" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ScenarioResultSummary), global::Grpc.Testing.ScenarioResultSummary.Parser, new[]{ "Qps", "QpsPerServerCore", "ServerSystemTime", "ServerUserTime", "ClientSystemTime", "ClientUserTime", "Latency50", "Latency90", "Latency95", "Latency99", "Latency999", "ServerCpuUsage", "SuccessfulRequestsPerSecond", "FailedRequestsPerSecond", "ClientPollsPerRequest", "ServerPollsPerRequest" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ScenarioResultSummary), global::Grpc.Testing.ScenarioResultSummary.Parser, new[]{ "Qps", "QpsPerServerCore", "ServerSystemTime", "ServerUserTime", "ClientSystemTime", "ClientUserTime", "Latency50", "Latency90", "Latency95", "Latency99", "Latency999", "ServerCpuUsage", "SuccessfulRequestsPerSecond", "FailedRequestsPerSecond", "ClientPollsPerRequest", "ServerPollsPerRequest", "ServerQueriesPerCpuSec", "ClientQueriesPerCpuSec" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ScenarioResult), global::Grpc.Testing.ScenarioResult.Parser, new[]{ "Scenario", "Latencies", "ClientStats", "ServerStats", "ServerCores", "Summary", "ClientSuccess", "ServerSuccess", "RequestResults" }, null, null, null) })); } @@ -589,6 +592,7 @@ namespace Grpc.Testing { public SecurityParams(SecurityParams other) : this() { useTestCa_ = other.useTestCa_; serverHostOverride_ = other.serverHostOverride_; + credType_ = other.credType_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -618,6 +622,17 @@ namespace Grpc.Testing { } } + /// Field number for the "cred_type" field. + public const int CredTypeFieldNumber = 3; + private string credType_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string CredType { + get { return credType_; } + set { + credType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as SecurityParams); @@ -633,6 +648,7 @@ namespace Grpc.Testing { } if (UseTestCa != other.UseTestCa) return false; if (ServerHostOverride != other.ServerHostOverride) return false; + if (CredType != other.CredType) return false; return true; } @@ -641,6 +657,7 @@ namespace Grpc.Testing { int hash = 1; if (UseTestCa != false) hash ^= UseTestCa.GetHashCode(); if (ServerHostOverride.Length != 0) hash ^= ServerHostOverride.GetHashCode(); + if (CredType.Length != 0) hash ^= CredType.GetHashCode(); return hash; } @@ -659,6 +676,10 @@ namespace Grpc.Testing { output.WriteRawTag(18); output.WriteString(ServerHostOverride); } + if (CredType.Length != 0) { + output.WriteRawTag(26); + output.WriteString(CredType); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -670,6 +691,9 @@ namespace Grpc.Testing { if (ServerHostOverride.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(ServerHostOverride); } + if (CredType.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CredType); + } return size; } @@ -684,6 +708,9 @@ namespace Grpc.Testing { if (other.ServerHostOverride.Length != 0) { ServerHostOverride = other.ServerHostOverride; } + if (other.CredType.Length != 0) { + CredType = other.CredType; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -702,6 +729,10 @@ namespace Grpc.Testing { ServerHostOverride = input.ReadString(); break; } + case 26: { + CredType = input.ReadString(); + break; + } } } } @@ -1945,6 +1976,7 @@ namespace Grpc.Testing { otherServerApi_ = other.otherServerApi_; threadsPerCq_ = other.threadsPerCq_; resourceQuotaSize_ = other.resourceQuotaSize_; + channelArgs_ = other.channelArgs_.Clone(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2088,6 +2120,16 @@ namespace Grpc.Testing { } } + /// Field number for the "channel_args" field. + public const int ChannelArgsFieldNumber = 1002; + private static readonly pb::FieldCodec _repeated_channelArgs_codec + = pb::FieldCodec.ForMessage(8018, global::Grpc.Testing.ChannelArg.Parser); + private readonly pbc::RepeatedField channelArgs_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ChannelArgs { + get { return channelArgs_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ServerConfig); @@ -2111,6 +2153,7 @@ namespace Grpc.Testing { if (OtherServerApi != other.OtherServerApi) return false; if (ThreadsPerCq != other.ThreadsPerCq) return false; if (ResourceQuotaSize != other.ResourceQuotaSize) return false; + if(!channelArgs_.Equals(other.channelArgs_)) return false; return true; } @@ -2127,6 +2170,7 @@ namespace Grpc.Testing { if (OtherServerApi.Length != 0) hash ^= OtherServerApi.GetHashCode(); if (ThreadsPerCq != 0) hash ^= ThreadsPerCq.GetHashCode(); if (ResourceQuotaSize != 0) hash ^= ResourceQuotaSize.GetHashCode(); + hash ^= channelArgs_.GetHashCode(); return hash; } @@ -2174,6 +2218,7 @@ namespace Grpc.Testing { output.WriteRawTag(200, 62); output.WriteInt32(ResourceQuotaSize); } + channelArgs_.WriteTo(output, _repeated_channelArgs_codec); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2207,6 +2252,7 @@ namespace Grpc.Testing { if (ResourceQuotaSize != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32Size(ResourceQuotaSize); } + size += channelArgs_.CalculateSize(_repeated_channelArgs_codec); return size; } @@ -2249,6 +2295,7 @@ namespace Grpc.Testing { if (other.ResourceQuotaSize != 0) { ResourceQuotaSize = other.ResourceQuotaSize; } + channelArgs_.Add(other.channelArgs_); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2306,6 +2353,10 @@ namespace Grpc.Testing { ResourceQuotaSize = input.ReadInt32(); break; } + case 8018: { + channelArgs_.AddEntriesFrom(input, _repeated_channelArgs_codec); + break; + } } } } @@ -3489,6 +3540,8 @@ namespace Grpc.Testing { failedRequestsPerSecond_ = other.failedRequestsPerSecond_; clientPollsPerRequest_ = other.clientPollsPerRequest_; serverPollsPerRequest_ = other.serverPollsPerRequest_; + serverQueriesPerCpuSec_ = other.serverQueriesPerCpuSec_; + clientQueriesPerCpuSec_ = other.clientQueriesPerCpuSec_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3702,6 +3755,31 @@ namespace Grpc.Testing { } } + /// Field number for the "server_queries_per_cpu_sec" field. + public const int ServerQueriesPerCpuSecFieldNumber = 17; + private double serverQueriesPerCpuSec_; + /// + /// Queries per CPU-sec over all servers or clients + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double ServerQueriesPerCpuSec { + get { return serverQueriesPerCpuSec_; } + set { + serverQueriesPerCpuSec_ = value; + } + } + + /// Field number for the "client_queries_per_cpu_sec" field. + public const int ClientQueriesPerCpuSecFieldNumber = 18; + private double clientQueriesPerCpuSec_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double ClientQueriesPerCpuSec { + get { return clientQueriesPerCpuSec_; } + set { + clientQueriesPerCpuSec_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ScenarioResultSummary); @@ -3731,6 +3809,8 @@ namespace Grpc.Testing { if (FailedRequestsPerSecond != other.FailedRequestsPerSecond) return false; if (ClientPollsPerRequest != other.ClientPollsPerRequest) return false; if (ServerPollsPerRequest != other.ServerPollsPerRequest) return false; + if (ServerQueriesPerCpuSec != other.ServerQueriesPerCpuSec) return false; + if (ClientQueriesPerCpuSec != other.ClientQueriesPerCpuSec) return false; return true; } @@ -3753,6 +3833,8 @@ namespace Grpc.Testing { if (FailedRequestsPerSecond != 0D) hash ^= FailedRequestsPerSecond.GetHashCode(); if (ClientPollsPerRequest != 0D) hash ^= ClientPollsPerRequest.GetHashCode(); if (ServerPollsPerRequest != 0D) hash ^= ServerPollsPerRequest.GetHashCode(); + if (ServerQueriesPerCpuSec != 0D) hash ^= ServerQueriesPerCpuSec.GetHashCode(); + if (ClientQueriesPerCpuSec != 0D) hash ^= ClientQueriesPerCpuSec.GetHashCode(); return hash; } @@ -3827,6 +3909,14 @@ namespace Grpc.Testing { output.WriteRawTag(129, 1); output.WriteDouble(ServerPollsPerRequest); } + if (ServerQueriesPerCpuSec != 0D) { + output.WriteRawTag(137, 1); + output.WriteDouble(ServerQueriesPerCpuSec); + } + if (ClientQueriesPerCpuSec != 0D) { + output.WriteRawTag(145, 1); + output.WriteDouble(ClientQueriesPerCpuSec); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3880,6 +3970,12 @@ namespace Grpc.Testing { if (ServerPollsPerRequest != 0D) { size += 2 + 8; } + if (ServerQueriesPerCpuSec != 0D) { + size += 2 + 8; + } + if (ClientQueriesPerCpuSec != 0D) { + size += 2 + 8; + } return size; } @@ -3936,6 +4032,12 @@ namespace Grpc.Testing { if (other.ServerPollsPerRequest != 0D) { ServerPollsPerRequest = other.ServerPollsPerRequest; } + if (other.ServerQueriesPerCpuSec != 0D) { + ServerQueriesPerCpuSec = other.ServerQueriesPerCpuSec; + } + if (other.ClientQueriesPerCpuSec != 0D) { + ClientQueriesPerCpuSec = other.ClientQueriesPerCpuSec; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4010,6 +4112,14 @@ namespace Grpc.Testing { ServerPollsPerRequest = input.ReadDouble(); break; } + case 137: { + ServerQueriesPerCpuSec = input.ReadDouble(); + break; + } + case 145: { + ClientQueriesPerCpuSec = input.ReadDouble(); + break; + } } } } diff --git a/src/csharp/Grpc.IntegrationTesting/CustomErrorDetailsTest.cs b/src/csharp/Grpc.IntegrationTesting/CustomErrorDetailsTest.cs index 374c6fc23f0..5d22d77ada8 100644 --- a/src/csharp/Grpc.IntegrationTesting/CustomErrorDetailsTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/CustomErrorDetailsTest.cs @@ -42,7 +42,7 @@ namespace Grpc.IntegrationTesting Channel channel; TestService.TestServiceClient client; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755 @@ -57,7 +57,7 @@ namespace Grpc.IntegrationTesting client = new TestService.TestServiceClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); @@ -108,7 +108,7 @@ namespace Grpc.IntegrationTesting private class CustomErrorDetailsTestServiceImpl : TestService.TestServiceBase { - public override async Task UnaryCall(SimpleRequest request, ServerCallContext context) + public override Task UnaryCall(SimpleRequest request, ServerCallContext context) { try { diff --git a/src/csharp/Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs b/src/csharp/Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs index a97818a164e..adeec05699b 100644 --- a/src/csharp/Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs @@ -65,7 +65,7 @@ namespace Grpc.IntegrationTesting } [Test] - public async Task UnimplementedByDefault_ClientStreaming() + public void UnimplementedByDefault_ClientStreaming() { var call = client.StreamingInputCall(); @@ -74,7 +74,7 @@ namespace Grpc.IntegrationTesting } [Test] - public async Task UnimplementedByDefault_ServerStreamingCall() + public void UnimplementedByDefault_ServerStreamingCall() { var call = client.StreamingOutputCall(new StreamingOutputCallRequest()); @@ -83,7 +83,7 @@ namespace Grpc.IntegrationTesting } [Test] - public async Task UnimplementedByDefault_DuplexStreamingCall() + public void UnimplementedByDefault_DuplexStreamingCall() { var call = client.FullDuplexCall(); diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index 6f2f06a6522..f5077fe0f74 100755 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -10,6 +10,7 @@ Grpc.IntegrationTesting $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs b/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs index 4a28f241242..e0fc259f087 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs @@ -38,7 +38,7 @@ namespace Grpc.IntegrationTesting Channel channel; TestService.TestServiceClient client; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755 @@ -58,7 +58,7 @@ namespace Grpc.IntegrationTesting client = new TestService.TestServiceClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); diff --git a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs index bc32c569275..9a664f35397 100644 --- a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs @@ -21,6 +21,7 @@ // Currently, 'Gauge' (i.e a metric that represents the measured value of // something at an instant of time) is the only metric type supported by the // service. +#pragma warning disable 1591 #region Designer generated code using System; diff --git a/src/csharp/Grpc.IntegrationTesting/RunnerClientServerTest.cs b/src/csharp/Grpc.IntegrationTesting/RunnerClientServerTest.cs index a766a5bba82..c5c92aa94a7 100644 --- a/src/csharp/Grpc.IntegrationTesting/RunnerClientServerTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/RunnerClientServerTest.cs @@ -35,7 +35,7 @@ namespace Grpc.IntegrationTesting { IServerRunner serverRunner; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { var serverConfig = new ServerConfig @@ -45,7 +45,7 @@ namespace Grpc.IntegrationTesting serverRunner = ServerRunners.CreateStarted(serverConfig); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { serverRunner.StopAsync().Wait(); diff --git a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs index bd5971e296f..bfae4ee6ace 100644 --- a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs @@ -17,6 +17,7 @@ // // An integration test service that covers all the method signature permutations // of unary/streaming requests/responses. +#pragma warning disable 1591 #region Designer generated code using System; diff --git a/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs b/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs index 974ed966e41..152d8feab98 100644 --- a/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs @@ -41,7 +41,7 @@ namespace Grpc.IntegrationTesting Channel channel; TestService.TestServiceClient client; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { var rootCert = File.ReadAllText(TestCredentials.ClientCertAuthorityPath); @@ -69,7 +69,7 @@ namespace Grpc.IntegrationTesting client = new TestService.TestServiceClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); @@ -94,15 +94,15 @@ namespace Grpc.IntegrationTesting private class SslCredentialsTestServiceImpl : TestService.TestServiceBase { - public override async Task UnaryCall(SimpleRequest request, ServerCallContext context) + public override Task UnaryCall(SimpleRequest request, ServerCallContext context) { - return new SimpleResponse { Payload = CreateZerosPayload(request.ResponseSize) }; + return Task.FromResult(new SimpleResponse { Payload = CreateZerosPayload(request.ResponseSize) }); } public override async Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context) { var authContext = context.AuthContext; - await requestStream.ForEachAsync(async request => {}); + await requestStream.ForEachAsync(request => TaskUtils.CompletedTask); Assert.IsTrue(authContext.IsPeerAuthenticated); Assert.AreEqual("x509_subject_alternative_name", authContext.PeerIdentityPropertyName); diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index b180d097bdb..b419dd17026 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -18,6 +18,7 @@ // An integration test service that covers all the method signature permutations // of unary/streaming requests/responses. // +#pragma warning disable 1591 #region Designer generated code using System; diff --git a/src/csharp/Grpc.IntegrationTesting/TestServiceImpl.cs b/src/csharp/Grpc.IntegrationTesting/TestServiceImpl.cs index ad033515725..09725123d9f 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestServiceImpl.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestServiceImpl.cs @@ -63,9 +63,10 @@ namespace Grpc.Testing await EnsureEchoMetadataAsync(context); int sum = 0; - await requestStream.ForEachAsync(async request => + await requestStream.ForEachAsync(request => { sum += request.Payload.Body.Length; + return TaskUtils.CompletedTask; }); return new StreamingInputCallResponse { AggregatedPayloadSize = sum }; } @@ -85,7 +86,7 @@ namespace Grpc.Testing }); } - public override async Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public override Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new NotImplementedException(); } diff --git a/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj b/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj index 26a940e4887..17797e1e1e8 100644 --- a/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj +++ b/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj @@ -10,6 +10,7 @@ Grpc.Microbenchmarks $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj b/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj index af6ade852b2..cf756c68ad3 100755 --- a/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj +++ b/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj @@ -10,6 +10,7 @@ Grpc.Reflection.Tests $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs b/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs index 7e894edd315..76f8cfadcfd 100644 --- a/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs +++ b/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs @@ -38,7 +38,7 @@ namespace Grpc.Reflection.Tests ServerReflection.ServerReflectionClient client; ReflectionServiceImpl serviceImpl; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { serviceImpl = new ReflectionServiceImpl(ServerReflection.Descriptor); @@ -55,7 +55,7 @@ namespace Grpc.Reflection.Tests client = new ServerReflection.ServerReflectionClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); diff --git a/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj b/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj index 929a78edcb5..b77fd69aeeb 100755 --- a/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj +++ b/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj @@ -18,6 +18,7 @@ true true true + true diff --git a/src/csharp/Grpc.Reflection/ReflectionGrpc.cs b/src/csharp/Grpc.Reflection/ReflectionGrpc.cs index 0af76eefedb..58439577e30 100644 --- a/src/csharp/Grpc.Reflection/ReflectionGrpc.cs +++ b/src/csharp/Grpc.Reflection/ReflectionGrpc.cs @@ -17,6 +17,7 @@ // // Service exported by server reflection // +#pragma warning disable 1591 #region Designer generated code using System; diff --git a/src/csharp/Grpc.Reflection/ReflectionServiceImpl.cs b/src/csharp/Grpc.Reflection/ReflectionServiceImpl.cs index 9f27a9491dd..1eaf10bfb84 100644 --- a/src/csharp/Grpc.Reflection/ReflectionServiceImpl.cs +++ b/src/csharp/Grpc.Reflection/ReflectionServiceImpl.cs @@ -60,6 +60,9 @@ namespace Grpc.Reflection { } + /// + /// Processes a stream of server reflection requests. + /// public override async Task ServerReflectionInfo(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { while (await requestStream.MoveNext()) diff --git a/src/csharp/global.json b/src/csharp/global.json new file mode 100644 index 00000000000..e4b797ee8ef --- /dev/null +++ b/src/csharp/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "1.0.0" + } +}