From 63b26a3d515e4f621ca1c2121e53464f871e1bf1 Mon Sep 17 00:00:00 2001 From: Ivan Migalev Date: Sat, 2 Dec 2023 18:03:34 +0100 Subject: [PATCH] ProcessWatchdogTest: isolate logger --- rd-net/Test.Lifetimes/Diagnostics/ProcessWatchdogTest.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rd-net/Test.Lifetimes/Diagnostics/ProcessWatchdogTest.cs b/rd-net/Test.Lifetimes/Diagnostics/ProcessWatchdogTest.cs index aac9213fa..4927fa515 100644 --- a/rd-net/Test.Lifetimes/Diagnostics/ProcessWatchdogTest.cs +++ b/rd-net/Test.Lifetimes/Diagnostics/ProcessWatchdogTest.cs @@ -2,6 +2,7 @@ using System; using System.Diagnostics; using System.Globalization; +using System.Linq; using System.Threading.Tasks; using JetBrains.Core; using JetBrains.Diagnostics; @@ -11,7 +12,7 @@ namespace Test.Lifetimes.Diagnostics; -public class ProcessWatchdogTest +public class ProcessWatchdogTest : LifetimesTestBase { [Test] public Task TestWithSleepingProcess() => DoTest(StartSleepingProcess, true); @@ -52,6 +53,9 @@ private static Task DoTest(Func processCreator, bool assertAlive) => Li { Assert.Fail($"Termination of process {process.Id} wasn't detected during the timeout."); } + + var exs = Assert.Throws(TestLogger.ExceptionLogger.ThrowLoggedExceptions).InnerExceptions; + Assert.IsTrue(exs.All(e => e.Message.Contains($"Parent process PID:{process.Id} has quit, killing ourselves via Process.Kill"))); }); private Process StartSleepingProcess()