diff --git a/test/E2ETests/DeploymentUtility.cs b/test/E2ETests/DeploymentUtility.cs index 80683793d6..205d9e5f4e 100644 --- a/test/E2ETests/DeploymentUtility.cs +++ b/test/E2ETests/DeploymentUtility.cs @@ -48,17 +48,23 @@ namespace E2ETests string applicationPath = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, APP_RELATIVE_PATH)); //Tweak the %PATH% to the point to the right KREFLAVOR Environment.SetEnvironmentVariable("PATH", SwitchPathToKreFlavor(kreFlavor)); + var backupKreDefaultLibPath = Environment.GetEnvironmentVariable("KRE_DEFAULT_LIB"); //To avoid the KRE_DEFAULT_LIB of the test process flowing into Helios, set it to empty Environment.SetEnvironmentVariable("KRE_DEFAULT_LIB", string.Empty); + Process hostProcess = null; if (hostType == HostType.Helios) { - return StartHeliosHost(applicationPath); + hostProcess = StartHeliosHost(applicationPath); } else { - return StartSelfHost(applicationPath, identityDbName); + hostProcess = StartSelfHost(applicationPath, identityDbName); } + + //Restore the KRE_DEFAULT_LIB after starting the host process + Environment.SetEnvironmentVariable("KRE_DEFAULT_LIB", backupKreDefaultLibPath); + return hostProcess; } private static Process StartHeliosHost(string applicationPath) diff --git a/test/E2ETests/SmokeTests.cs b/test/E2ETests/SmokeTests.cs index b0711d9a22..12d402c7bc 100644 --- a/test/E2ETests/SmokeTests.cs +++ b/test/E2ETests/SmokeTests.cs @@ -110,6 +110,15 @@ namespace E2ETests { //Shutdown the host process hostProcess.Kill(); + hostProcess.WaitForExit(5 * 1000); + if (!hostProcess.HasExited) + { + Console.WriteLine("Unable to terminate the host process with process Id '{0}", hostProcess.Id); + } + else + { + Console.WriteLine("Successfully terminated host process with process Id '{0}'", hostProcess.Id); + } } DbUtils.DropDatabase(musicStoreDbName);