Skip to content
Snippets Groups Projects
Commit 7c7865b0 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

eliminate crosstalk between C# tests

parent fa729ed9
No related branches found
No related tags found
No related merge requests found
...@@ -141,7 +141,8 @@ namespace Grpc.Core.Tests ...@@ -141,7 +141,8 @@ namespace Grpc.Core.Tests
{ {
if (server == null) if (server == null)
{ {
server = new Server // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) })
{ {
Services = { serviceDefinition }, Services = { serviceDefinition },
Ports = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } } Ports = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } }
......
...@@ -55,7 +55,8 @@ namespace Math.Tests ...@@ -55,7 +55,8 @@ namespace Math.Tests
[TestFixtureSetUp] [TestFixtureSetUp]
public void Init() public void Init()
{ {
server = new Server // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) })
{ {
Services = { Math.BindService(new MathServiceImpl()) }, Services = { Math.BindService(new MathServiceImpl()) },
Ports = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } } Ports = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } }
......
...@@ -57,7 +57,8 @@ namespace Grpc.HealthCheck.Tests ...@@ -57,7 +57,8 @@ namespace Grpc.HealthCheck.Tests
{ {
serviceImpl = new HealthServiceImpl(); serviceImpl = new HealthServiceImpl();
server = new Server // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) })
{ {
Services = { Grpc.Health.V1.Health.BindService(serviceImpl) }, Services = { Grpc.Health.V1.Health.BindService(serviceImpl) },
Ports = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } } Ports = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } }
......
...@@ -54,7 +54,8 @@ namespace Grpc.IntegrationTesting ...@@ -54,7 +54,8 @@ namespace Grpc.IntegrationTesting
[SetUp] [SetUp]
public void Init() public void Init()
{ {
server = new Server // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) })
{ {
Services = { TestService.BindService(new UnimplementedTestServiceImpl()) }, Services = { TestService.BindService(new UnimplementedTestServiceImpl()) },
Ports = { { Host, ServerPort.PickUnused, SslServerCredentials.Insecure } } Ports = { { Host, ServerPort.PickUnused, SslServerCredentials.Insecure } }
......
...@@ -56,7 +56,8 @@ namespace Grpc.IntegrationTesting ...@@ -56,7 +56,8 @@ namespace Grpc.IntegrationTesting
[TestFixtureSetUp] [TestFixtureSetUp]
public void Init() public void Init()
{ {
server = new Server // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) })
{ {
Services = { TestService.BindService(new TestServiceImpl()) }, Services = { TestService.BindService(new TestServiceImpl()) },
Ports = { { Host, ServerPort.PickUnused, TestCredentials.CreateSslServerCredentials() } } Ports = { { Host, ServerPort.PickUnused, TestCredentials.CreateSslServerCredentials() } }
......
...@@ -56,7 +56,8 @@ namespace Grpc.IntegrationTesting ...@@ -56,7 +56,8 @@ namespace Grpc.IntegrationTesting
[SetUp] [SetUp]
public void Init() public void Init()
{ {
server = new Server // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) })
{ {
Services = { TestService.BindService(new FakeTestService()) }, Services = { TestService.BindService(new FakeTestService()) },
Ports = { { Host, ServerPort.PickUnused, TestCredentials.CreateSslServerCredentials() } } Ports = { { Host, ServerPort.PickUnused, TestCredentials.CreateSslServerCredentials() } }
......
...@@ -67,7 +67,8 @@ namespace Grpc.IntegrationTesting ...@@ -67,7 +67,8 @@ namespace Grpc.IntegrationTesting
var serverCredentials = new SslServerCredentials(new[] { keyCertPair }, rootCert, true); var serverCredentials = new SslServerCredentials(new[] { keyCertPair }, rootCert, true);
var clientCredentials = new SslCredentials(rootCert, keyCertPair); var clientCredentials = new SslCredentials(rootCert, keyCertPair);
server = new Server // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) })
{ {
Services = { TestService.BindService(new SslCredentialsTestServiceImpl()) }, Services = { TestService.BindService(new SslCredentialsTestServiceImpl()) },
Ports = { { Host, ServerPort.PickUnused, serverCredentials } } Ports = { { Host, ServerPort.PickUnused, serverCredentials } }
......
...@@ -58,7 +58,8 @@ namespace Grpc.Reflection.Tests ...@@ -58,7 +58,8 @@ namespace Grpc.Reflection.Tests
{ {
serviceImpl = new ReflectionServiceImpl(ServerReflection.Descriptor); serviceImpl = new ReflectionServiceImpl(ServerReflection.Descriptor);
server = new Server // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) })
{ {
Services = { ServerReflection.BindService(serviceImpl) }, Services = { ServerReflection.BindService(serviceImpl) },
Ports = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } } Ports = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment