diff --git a/src/tests/Interop/COM/NETClients/Lifetime/Program.cs b/src/tests/Interop/COM/NETClients/Lifetime/Program.cs index a0a6c254d4d996..19b56aee130b73 100644 --- a/src/tests/Interop/COM/NETClients/Lifetime/Program.cs +++ b/src/tests/Interop/COM/NETClients/Lifetime/Program.cs @@ -148,13 +148,13 @@ static int RunOnSTAThread(Action action) try { action(); + result = TestPassed; } catch (Exception e) { Console.WriteLine($"Test Failure: {e}"); result = TestFailed; } - result = TestPassed; }); staThread.SetApartmentState(ApartmentState.STA);