public void CouldOpenProcessConfig() { //Settings.EnableChaosMonkey = true; //ChaosMonkey.Force = true; StartupConfig.AssumeDeadAfterSeconds = 1; var path = TestUtils.GetPath(); // ProcessConfig.Init(path); var pc1 = new ProcessConfig(path); var pc2 = new ProcessConfig(path); var wpid1 = pc1.Wpid; var wpid2 = pc2.Wpid; Console.WriteLine(ProcessConfig.IsPidAlive(1234567)); Console.WriteLine(ProcessConfig.IsPidAlive(System.Diagnostics.Process.GetCurrentProcess().Id)); Console.WriteLine("1 ------"); Console.WriteLine(ProcessConfig.IsWpidAlive(wpid2)); Console.WriteLine(ProcessConfig.IsWpidAlive(wpid1)); pc2.TogglePaused(); Thread.Sleep((StartupConfig.AssumeDeadAfterSeconds + 1) * 1000); Console.WriteLine("2 ------"); Console.WriteLine(ProcessConfig.IsWpidAlive(wpid2)); Console.WriteLine(ProcessConfig.IsWpidAlive(wpid1)); pc2.Suicide(); pc1.Suicide(); Console.WriteLine("3 ------"); Console.WriteLine(ProcessConfig.IsWpidAlive(wpid2)); Console.WriteLine(ProcessConfig.IsWpidAlive(wpid1)); Console.WriteLine("4 ------"); Console.WriteLine(ProcessConfig.IsWpidAlive(wpid2)); Console.WriteLine(ProcessConfig.IsWpidAlive(wpid1)); foreach (var deadWpid in ProcessConfig.DeadWpids) { Console.WriteLine($"Known dead wpid: " + deadWpid); } pc1.Dispose(); pc2.Dispose(); }