Adding some more diagnostic logs for cleanup
This is to confirm that the host process started by the tests are cleaned up at the end of the test.
This commit is contained in:
parent
a4ae444594
commit
e2b4842680
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue