From ba2347a98e2fad04dc3a39ee567fe67b1bfe61f3 Mon Sep 17 00:00:00 2001 From: Eran Ofer Date: Mon, 28 May 2018 08:33:47 +0300 Subject: [PATCH 1/6] Host stop is now taking in account onStopWaitTime And ServiceDrarinTime before performing force exit Refactor onStopWaitTime change to onStopWaitTimeSec --- .../Service/ServiceHostBase.cs | 3 ++- Gigya.Microdot.SharedLogic/ServiceArguments.cs | 11 +++++------ .../Service/NonOrleansServiceTester.cs | 2 +- .../Service/ServiceTesterBase.cs | 8 ++++---- .../Service/ServiceTesterExtensions.cs | 3 +-- Gigya.Microdot.Testing/Service/ServiceTester.cs | 16 ++++++++-------- .../NonOrleansMicroService/MicroServiceTests.cs | 15 ++++++++++++--- .../HealthCheckTests.cs | 2 +- 8 files changed, 34 insertions(+), 26 deletions(-) diff --git a/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs b/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs index ea14e24e..61462a75 100644 --- a/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs +++ b/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs @@ -179,7 +179,8 @@ public void Run(ServiceArguments argumentsOverride = null) StopEvent.WaitOne(); Console.WriteLine(" *** Shutting down... *** "); - Task.Run(() => OnStop()).Wait(Arguments.OnStopWaitTime ?? TimeSpan.FromSeconds(10)); + + Task.Run(() => OnStop()).Wait(TimeSpan.FromSeconds((Arguments.OnStopWaitTimeSec??10)+Arguments.ServiceDrainTimeSec??0)); ServiceStartedEvent = new TaskCompletionSource(); ServiceStoppedEvent.SetResult(null); diff --git a/Gigya.Microdot.SharedLogic/ServiceArguments.cs b/Gigya.Microdot.SharedLogic/ServiceArguments.cs index 97d507f2..a8c93f3c 100644 --- a/Gigya.Microdot.SharedLogic/ServiceArguments.cs +++ b/Gigya.Microdot.SharedLogic/ServiceArguments.cs @@ -77,7 +77,7 @@ public class ServiceArguments /// /// Defines wait time before service is stoping, default is 10 seconds. /// - public TimeSpan? OnStopWaitTime { get; } + public int? OnStopWaitTimeSec { get; } /// /// An array of processor IDs the service should run on, otherwise null if none are is specified. This also affects the degree @@ -98,7 +98,7 @@ public ServiceArguments(ServiceStartupMode serviceStartupMode = ServiceStartupMo ConsoleOutputMode consoleOutputMode = ConsoleOutputMode.Unspecified, SiloClusterMode siloClusterMode = SiloClusterMode.Unspecified, int? basePortOverride = null, string instanceName = null, - int? shutdownWhenPidExits = null, int? slotNumber = null, TimeSpan? onStopWaitTimeInMs=null,int? serviceDrainTime=null) + int? shutdownWhenPidExits = null, int? slotNumber = null, int? shutdownWaitTimeSec=null,int? serviceDrainTimeSec=null) { ServiceStartupMode = serviceStartupMode; ConsoleOutputMode = consoleOutputMode; @@ -107,8 +107,8 @@ public ServiceArguments(ServiceStartupMode serviceStartupMode = ServiceStartupMo InstanceName = instanceName; ShutdownWhenPidExits = shutdownWhenPidExits; SlotNumber = slotNumber; - OnStopWaitTime = onStopWaitTimeInMs; - ServiceDrainTimeSec = serviceDrainTime; + OnStopWaitTimeSec = shutdownWaitTimeSec; + ServiceDrainTimeSec = serviceDrainTimeSec; ApplyDefaults(); } @@ -126,13 +126,12 @@ public ServiceArguments(string[] args) InstanceName = ParseStringArg(nameof(InstanceName), args); ShutdownWhenPidExits = TryParseInt(ParseStringArg(nameof(ShutdownWhenPidExits), args)); SlotNumber = TryParseInt(ParseStringArg(nameof(SlotNumber), args)); - OnStopWaitTime = TryParseTimeSpan(ParseStringArg(nameof(OnStopWaitTime), args)); + OnStopWaitTimeSec = TryParseInt(ParseStringArg(nameof(OnStopWaitTimeSec), args)); ServiceDrainTimeSec = TryParseInt(ParseStringArg(nameof(ServiceDrainTimeSec), args)); ProcessorAffinity = ParseProcessorIds(ParseStringArg(nameof(ProcessorAffinity), args)); ApplyDefaults(); } - private static TimeSpan? TryParseTimeSpan(string str) { return TimeSpan.TryParse(str, out TimeSpan val) ? (TimeSpan?)val : null; } private static int? TryParseInt(string str) { return int.TryParse(str, out int val) ? (int?)val : null; } diff --git a/Gigya.Microdot.Testing.Shared/Service/NonOrleansServiceTester.cs b/Gigya.Microdot.Testing.Shared/Service/NonOrleansServiceTester.cs index 1706ea68..229f3046 100644 --- a/Gigya.Microdot.Testing.Shared/Service/NonOrleansServiceTester.cs +++ b/Gigya.Microdot.Testing.Shared/Service/NonOrleansServiceTester.cs @@ -35,7 +35,7 @@ namespace Gigya.Microdot.Testing.Shared.Service public NonOrleansServiceTester(int basePortOverride, IResolutionRoot resolutionRoot, TimeSpan? shutdownWaitTime = null) { - var serviceArguments = GetServiceArguments(basePortOverride, false, shutdownWaitTime); + var serviceArguments = GetServiceArguments(basePortOverride, false, shutdownWaitTime.HasValue?(int?)shutdownWaitTime.Value.TotalSeconds:null); BasePort = basePortOverride; ResolutionRoot = resolutionRoot; diff --git a/Gigya.Microdot.Testing.Shared/Service/ServiceTesterBase.cs b/Gigya.Microdot.Testing.Shared/Service/ServiceTesterBase.cs index 35b44199..6b1e090b 100644 --- a/Gigya.Microdot.Testing.Shared/Service/ServiceTesterBase.cs +++ b/Gigya.Microdot.Testing.Shared/Service/ServiceTesterBase.cs @@ -112,23 +112,23 @@ public virtual ServiceProxyProvider GetServiceProxyProvider(string serviceName, return provider; } - protected virtual ServiceArguments GetServiceArguments(int? basePortOverride, bool isSecondary, TimeSpan? shutdownWaitTime) + protected virtual ServiceArguments GetServiceArguments(int? basePortOverride, bool isSecondary, int? shutdownWaitTime) { if (isSecondary && basePortOverride == null) throw new ArgumentException("You must specify a basePortOverride when running a secondary silo."); var siloClusterMode = isSecondary ? SiloClusterMode.SecondaryNode : SiloClusterMode.PrimaryNode; - ServiceArguments arguments = new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, basePortOverride: basePortOverride, siloClusterMode: siloClusterMode, onStopWaitTimeInMs: shutdownWaitTime); + ServiceArguments arguments = new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, basePortOverride: basePortOverride, siloClusterMode: siloClusterMode, shutdownWaitTimeSec: shutdownWaitTime); if (basePortOverride != null) return arguments; - var serviceArguments = new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, siloClusterMode: siloClusterMode, onStopWaitTimeInMs: shutdownWaitTime); + var serviceArguments = new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, siloClusterMode: siloClusterMode, shutdownWaitTimeSec: shutdownWaitTime); var commonConfig = new BaseCommonConfig(serviceArguments); var mapper = new OrleansServiceInterfaceMapper(new AssemblyProvider(new ApplicationDirectoryProvider(commonConfig), commonConfig, Log)); var basePort = mapper.ServiceInterfaceTypes.First().GetCustomAttribute().BasePort; - return new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, basePortOverride: basePort, onStopWaitTimeInMs: shutdownWaitTime); + return new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, basePortOverride: basePort, shutdownWaitTimeSec: shutdownWaitTime); } public abstract void Dispose(); diff --git a/Gigya.Microdot.Testing.Shared/Service/ServiceTesterExtensions.cs b/Gigya.Microdot.Testing.Shared/Service/ServiceTesterExtensions.cs index 4b6f8d18..307cabfa 100644 --- a/Gigya.Microdot.Testing.Shared/Service/ServiceTesterExtensions.cs +++ b/Gigya.Microdot.Testing.Shared/Service/ServiceTesterExtensions.cs @@ -35,8 +35,7 @@ public static NonOrleansServiceTester GetServiceTesterForNonOrlean { NonOrleansServiceTester tester = kernel.Get>( new ConstructorArgument(nameof(basePortOverride), basePortOverride), - new ConstructorArgument(nameof(shutdownWaitTime), shutdownWaitTime) - ); + new ConstructorArgument(nameof(shutdownWaitTime),shutdownWaitTime)); return tester; } diff --git a/Gigya.Microdot.Testing/Service/ServiceTester.cs b/Gigya.Microdot.Testing/Service/ServiceTester.cs index 457afc86..ebb1ab9b 100644 --- a/Gigya.Microdot.Testing/Service/ServiceTester.cs +++ b/Gigya.Microdot.Testing/Service/ServiceTester.cs @@ -55,14 +55,14 @@ namespace Gigya.Microdot.Testing.Service private HttpListener LogListener { get; set; } - public ServiceTester(int? basePortOverride, bool isSecondary, ILog log, IResolutionRoot resolutionRoot, TimeSpan? shutdownWaitTime = null, bool writeLogToFile = false,int? serviceDrainTime=null) + public ServiceTester(int? basePortOverride, bool isSecondary, ILog log, IResolutionRoot resolutionRoot, TimeSpan? shutdownWaitTime = null, bool writeLogToFile = false,int? serviceDrainTimeSec=null) { Log = log; ResolutionRoot = resolutionRoot; // ReSharper disable VirtualMemberCallInContructor InitializeInfrastructure(); - var serviceArguments = GetServiceArguments(basePortOverride, isSecondary, shutdownWaitTime,serviceDrainTime); + var serviceArguments = GetServiceArguments(basePortOverride, isSecondary, shutdownWaitTime.HasValue?(int?)shutdownWaitTime.Value.TotalSeconds:null,serviceDrainTimeSec); BasePort = serviceArguments.BasePortOverride.Value; ServiceAppDomain = Common.CreateDomain(typeof(TServiceHost).Name + BasePort); @@ -202,23 +202,23 @@ protected virtual void InitializeInfrastructure() } - protected virtual ServiceArguments GetServiceArguments(int? basePortOverride, bool isSecondary, TimeSpan? shutdownWaitTime,int? serviceDrainTime) + protected virtual ServiceArguments GetServiceArguments(int? basePortOverride, bool isSecondary, int? shutdownWaitTime,int? serviceDrainTime) { if (isSecondary && basePortOverride == null) throw new ArgumentException("You must specify a basePortOverride when running a secondary silo."); var siloClusterMode = isSecondary ? SiloClusterMode.SecondaryNode : SiloClusterMode.PrimaryNode; - ServiceArguments arguments = new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, basePortOverride: basePortOverride, siloClusterMode: siloClusterMode, onStopWaitTimeInMs: shutdownWaitTime,serviceDrainTime:serviceDrainTime); + ServiceArguments arguments = new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, basePortOverride: basePortOverride, siloClusterMode: siloClusterMode, shutdownWaitTimeSec: shutdownWaitTime,serviceDrainTimeSec:serviceDrainTime); if (basePortOverride != null) return arguments; - var serviceArguments = new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, siloClusterMode: siloClusterMode, onStopWaitTimeInMs: shutdownWaitTime,serviceDrainTime:serviceDrainTime); + var serviceArguments = new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, siloClusterMode: siloClusterMode, shutdownWaitTimeSec: shutdownWaitTime,serviceDrainTimeSec:serviceDrainTime); var commonConfig = new BaseCommonConfig(serviceArguments); var mapper = new OrleansServiceInterfaceMapper(new AssemblyProvider(new ApplicationDirectoryProvider(commonConfig), commonConfig, Log)); var basePort = mapper.ServiceInterfaceTypes.First().GetCustomAttribute().BasePort; - return new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, basePortOverride: basePort, onStopWaitTimeInMs: shutdownWaitTime,serviceDrainTime:serviceDrainTime); + return new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive, basePortOverride: basePort, shutdownWaitTimeSec: shutdownWaitTime,serviceDrainTimeSec:serviceDrainTime); } @@ -315,7 +315,7 @@ public class TestTraceConfiguration : ITraceConfiguration public static class ServiceTesterExtensions { - public static ServiceTester GetServiceTester(this IResolutionRoot kernel, int? basePortOverride = null, bool isSecondary = false, TimeSpan? shutdownWaitTime = null, bool writeLogToFile = false,int? serviceDrainTime=null) + public static ServiceTester GetServiceTester(this IResolutionRoot kernel, int? basePortOverride = null, bool isSecondary = false, TimeSpan? shutdownWaitTime = null, bool writeLogToFile = false,int? serviceDrainTimeSec=null) where TServiceHost : MicrodotOrleansServiceHost, new() { ServiceTester tester = kernel.Get>( @@ -323,7 +323,7 @@ public static ServiceTester GetServiceTester(this IR new ConstructorArgument(nameof(isSecondary), isSecondary), new ConstructorArgument(nameof(shutdownWaitTime), shutdownWaitTime), new ConstructorArgument(nameof(writeLogToFile), writeLogToFile), - new ConstructorArgument(nameof(serviceDrainTime), serviceDrainTime) + new ConstructorArgument(nameof(serviceDrainTimeSec), serviceDrainTimeSec) ); return tester; diff --git a/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/MicroServiceTests.cs b/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/MicroServiceTests.cs index 60adf5c6..c8d1cc0f 100644 --- a/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/MicroServiceTests.cs +++ b/tests/Gigya.Microdot.Hosting.UnitTests/NonOrleansMicroService/MicroServiceTests.cs @@ -17,11 +17,20 @@ public class MicroServiceTests [Test] public async Task ShouldCallSelfHostServcie() { + NonOrleansServiceTester serviceTester = null; var testingKernel = new TestingKernel(); - var serviceTester = testingKernel.GetServiceTesterForNonOrleansService(1111, TimeSpan.FromSeconds(10)); + try + { + serviceTester = testingKernel.GetServiceTesterForNonOrleansService(1111, TimeSpan.FromSeconds(10)); + (await serviceTester.GetServiceProxy().Add(1, 2)).ShouldBe(3); + } + finally + { + serviceTester?.Dispose(); + testingKernel.Dispose(); + } + - (await serviceTester.GetServiceProxy().Add(1, 2)).ShouldBe(3); - serviceTester.Dispose(); } } diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs index 0a8c64b8..32893637 100644 --- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs +++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs @@ -55,7 +55,7 @@ public void TearDown() public async Task HealthCheck_ServcieDrain_StatueShouldBe521() { int port = 6755;//prevent prot collision, more then one silo is runing at the same time in this TestFixture. - var customServiceTester = AssemblyInitialize.ResolutionRoot.GetServiceTester(basePortOverride: port, serviceDrainTime: 10); + var customServiceTester = AssemblyInitialize.ResolutionRoot.GetServiceTester(basePortOverride: port, serviceDrainTimeSec: 10); var dispose = Task.Run(() => customServiceTester.Dispose()); await Task.Delay(200); From e08ee7cbb375f3f4339f605c9bc0512bf01921d9 Mon Sep 17 00:00:00 2001 From: Eran Ofer Date: Mon, 28 May 2018 11:10:54 +0300 Subject: [PATCH 2/6] small refactor --- Gigya.Microdot.Hosting/Service/ServiceHostBase.cs | 5 +++-- Gigya.Microdot.SharedLogic/ServiceArguments.cs | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs b/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs index 61462a75..32755110 100644 --- a/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs +++ b/Gigya.Microdot.Hosting/Service/ServiceHostBase.cs @@ -179,8 +179,9 @@ public void Run(ServiceArguments argumentsOverride = null) StopEvent.WaitOne(); Console.WriteLine(" *** Shutting down... *** "); - - Task.Run(() => OnStop()).Wait(TimeSpan.FromSeconds((Arguments.OnStopWaitTimeSec??10)+Arguments.ServiceDrainTimeSec??0)); + + + Task.Run(() => OnStop()).Wait(TimeSpan.FromSeconds(Arguments.OnStopWaitTimeSec + Arguments.ServiceDrainTimeSec ?? 0)); ServiceStartedEvent = new TaskCompletionSource(); ServiceStoppedEvent.SetResult(null); diff --git a/Gigya.Microdot.SharedLogic/ServiceArguments.cs b/Gigya.Microdot.SharedLogic/ServiceArguments.cs index a8c93f3c..50e7fddf 100644 --- a/Gigya.Microdot.SharedLogic/ServiceArguments.cs +++ b/Gigya.Microdot.SharedLogic/ServiceArguments.cs @@ -74,10 +74,11 @@ public class ServiceArguments /// Specifies drain time in this time the servcie status will be 521. /// public int? ServiceDrainTimeSec { get; } + /// - /// Defines wait time before service is stoping, default is 10 seconds. + /// Defines the time to wait for the service to stop, default is 10 seconds. After this time the service will be forcibly closed. /// - public int? OnStopWaitTimeSec { get; } + public int? OnStopWaitTimeSec { get; set; } /// /// An array of processor IDs the service should run on, otherwise null if none are is specified. This also affects the degree @@ -200,6 +201,10 @@ private void ApplyDefaults() throw new ArgumentOutOfRangeException(); } } + + if (OnStopWaitTimeSec == null) + OnStopWaitTimeSec = 10; + // ReSharper restore SwitchStatementMissingSomeCases } From ecc0a3596efff664cee07c96d7472554db67447d Mon Sep 17 00:00:00 2001 From: Eran Ofer Date: Sun, 3 Jun 2018 10:01:30 +0300 Subject: [PATCH 3/6] code review --- Gigya.Microdot.SharedLogic/ServiceArguments.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gigya.Microdot.SharedLogic/ServiceArguments.cs b/Gigya.Microdot.SharedLogic/ServiceArguments.cs index 50e7fddf..c599d9ea 100644 --- a/Gigya.Microdot.SharedLogic/ServiceArguments.cs +++ b/Gigya.Microdot.SharedLogic/ServiceArguments.cs @@ -76,7 +76,7 @@ public class ServiceArguments public int? ServiceDrainTimeSec { get; } /// - /// Defines the time to wait for the service to stop, default is 10 seconds. After this time the service will be forcibly closed. + /// Defines the time to wait for the service to stop, default is 10 seconds. Only after OnStopWaitTimeSec+ServiceDrainTimeSec the service will be forcibly closed. /// public int? OnStopWaitTimeSec { get; set; } From 1c775f61886ef4116bedea01997c735466a310bf Mon Sep 17 00:00:00 2001 From: Eran Ofer Date: Tue, 12 Jun 2018 08:42:43 +0300 Subject: [PATCH 4/6] fix test on nunit3-console --- .../Caching/Host/CachingProxyTests.cs | 3 ++- .../ServiceListenerTests/HttpServiceListenerTests.cs | 3 ++- .../ServiceListenerTests/MetricsTests.cs | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/Gigya.Microdot.UnitTests/Caching/Host/CachingProxyTests.cs b/tests/Gigya.Microdot.UnitTests/Caching/Host/CachingProxyTests.cs index c8fbcc17..9798b49d 100644 --- a/tests/Gigya.Microdot.UnitTests/Caching/Host/CachingProxyTests.cs +++ b/tests/Gigya.Microdot.UnitTests/Caching/Host/CachingProxyTests.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using Gigya.Microdot.Hosting.Service; +using Gigya.Microdot.SharedLogic; using Ninject; using NUnit.Framework; using Shouldly; @@ -37,7 +38,7 @@ public void SetUp() try { Host = new SlowServiceHost(k => { Service = k.Get(); }); - StopTask = Host.RunAsync(); + StopTask = Host.RunAsync(new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive)); } catch (Exception ex) { diff --git a/tests/Gigya.Microdot.UnitTests/ServiceListenerTests/HttpServiceListenerTests.cs b/tests/Gigya.Microdot.UnitTests/ServiceListenerTests/HttpServiceListenerTests.cs index 9d1ef8e3..95f227f0 100644 --- a/tests/Gigya.Microdot.UnitTests/ServiceListenerTests/HttpServiceListenerTests.cs +++ b/tests/Gigya.Microdot.UnitTests/ServiceListenerTests/HttpServiceListenerTests.cs @@ -11,6 +11,7 @@ using Gigya.Common.Contracts.Exceptions; using Gigya.Microdot.Fakes; using Gigya.Microdot.Hosting.Service; +using Gigya.Microdot.SharedLogic; using Gigya.Microdot.SharedLogic.Events; using Gigya.Microdot.SharedLogic.Exceptions; using Gigya.Microdot.Testing; @@ -54,7 +55,7 @@ public virtual void SetUp() TracingContext.SetRequestID("1"); _testinghost = new TestingHost(); - _stopTask = _testinghost.RunAsync(); + _stopTask = _testinghost.RunAsync(new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive)); } diff --git a/tests/Gigya.Microdot.UnitTests/ServiceListenerTests/MetricsTests.cs b/tests/Gigya.Microdot.UnitTests/ServiceListenerTests/MetricsTests.cs index 007ba6fd..1163fe95 100644 --- a/tests/Gigya.Microdot.UnitTests/ServiceListenerTests/MetricsTests.cs +++ b/tests/Gigya.Microdot.UnitTests/ServiceListenerTests/MetricsTests.cs @@ -51,7 +51,7 @@ public void TearDown() public void TestMetricsOnSuccess() { TestingHost testinghost = new TestingHost(); - var task = testinghost.RunAsync(); + var task = testinghost.RunAsync(new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive)); testinghost.Instance.Increment(0).Returns((ulong)1); @@ -73,7 +73,7 @@ public void TestMetricsOnSuccess() public void TestMetricsOnFailure() { TestingHost testinghost = new TestingHost(); - var task = testinghost.RunAsync(); + var task = testinghost.RunAsync(new ServiceArguments(ServiceStartupMode.CommandLineNonInteractive)); testinghost.Instance.When(a => a.DoSomething()).Do(x => { throw new Exception(); }); From db962ba04cd62d661a2ec97fe18373b85d9d5db3 Mon Sep 17 00:00:00 2001 From: Eran Ofer Date: Tue, 12 Jun 2018 11:33:01 +0300 Subject: [PATCH 5/6] run every group of test on deffrent port --- .../HealthCheckTests.cs | 10 +++++----- .../SchemaEndpointTests.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs index 32893637..7c212ed7 100644 --- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs +++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/HealthCheckTests.cs @@ -38,11 +38,11 @@ public class HealthCheckTests { private ServiceTester tester; - + private int mainPort = 9555; [OneTimeSetUp] public void SetUp() { - tester = AssemblyInitialize.ResolutionRoot.GetServiceTester(); + tester = AssemblyInitialize.ResolutionRoot.GetServiceTester(mainPort); } [OneTimeTearDown] @@ -69,7 +69,7 @@ public async Task HealthCheck_ServcieDrain_StatueShouldBe521() public void HealthCheck_NotHealthy_ShouldReturn500() { tester.GetGrainClient(0).SetHealth(false); - var httpResponseMessage = new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:6555/{nameof(IProgrammableHealth).Substring(1)}.status")).Result; + var httpResponseMessage = new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:{mainPort}/{nameof(IProgrammableHealth).Substring(1)}.status")).Result; httpResponseMessage.StatusCode.ShouldBe(HttpStatusCode.InternalServerError); } @@ -77,14 +77,14 @@ public void HealthCheck_NotHealthy_ShouldReturn500() public void HealthCheck_Healthy_ShouldReturn200() { tester.GetGrainClient(0).SetHealth(true); - var httpResponseMessage = new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:6555/{nameof(IProgrammableHealth).Substring(1)}.status")).Result; + var httpResponseMessage = new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:{mainPort}/{nameof(IProgrammableHealth).Substring(1)}.status")).Result; httpResponseMessage.StatusCode.ShouldBe(HttpStatusCode.OK); } [Test] public void HealthCheck_NotImplemented_ShouldReturn200() { - var httpResponseMessage = new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:6555/{nameof(ICalculatorService).Substring(1)}.status")).Result; + var httpResponseMessage = new HttpClient().GetAsync(new Uri($"http://{CurrentApplicationInfo.HostName}:{mainPort}/{nameof(ICalculatorService).Substring(1)}.status")).Result; httpResponseMessage.StatusCode.ShouldBe(HttpStatusCode.OK); httpResponseMessage.Content.ShouldNotBeNull(); } diff --git a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/SchemaEndpointTests.cs b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/SchemaEndpointTests.cs index 403c234e..0999b5d6 100644 --- a/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/SchemaEndpointTests.cs +++ b/tests/Gigya.Microdot.Orleans.Hosting.UnitTests/SchemaEndpointTests.cs @@ -43,7 +43,7 @@ public void SetUp() { try { - _tester = AssemblyInitialize.ResolutionRoot.GetServiceTester(); + _tester = AssemblyInitialize.ResolutionRoot.GetServiceTester(8555); _serviceProxyProvider = _tester.GetServiceProxyProvider("CalculatorService"); } catch (Exception e) From fb6048071867107662a630f4bcb9956b34580b62 Mon Sep 17 00:00:00 2001 From: Eran Ofer Date: Tue, 12 Jun 2018 12:06:26 +0300 Subject: [PATCH 6/6] change AssemblyVersion to 1.10.4.0 --- SolutionVersion.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SolutionVersion.cs b/SolutionVersion.cs index 0faa1fa6..14ed1a8e 100644 --- a/SolutionVersion.cs +++ b/SolutionVersion.cs @@ -28,9 +28,9 @@ [assembly: AssemblyCopyright("© 2018 Gigya Inc.")] [assembly: AssemblyDescription("Microdot Framework")] -[assembly: AssemblyVersion("1.10.3.0")] -[assembly: AssemblyFileVersion("1.10.3.0")] -[assembly: AssemblyInformationalVersion("1.10.3.0")] +[assembly: AssemblyVersion("1.10.4.0")] +[assembly: AssemblyFileVersion("1.10.4.0")] +[assembly: AssemblyInformationalVersion("1.10.4.0")] // Setting ComVisible to false makes the types in this assembly not visible