diff --git a/src/libraries/System.Transactions.Local/tests/OleTxTests.cs b/src/libraries/System.Transactions.Local/tests/OleTxTests.cs index 2b02792026a421..d071f03b51c896 100644 --- a/src/libraries/System.Transactions.Local/tests/OleTxTests.cs +++ b/src/libraries/System.Transactions.Local/tests/OleTxTests.cs @@ -335,7 +335,9 @@ public void Recovery() using (RemoteExecutor.Invoke( EnlistAndCrash, propagationTokenText, guid2.ToString(), secondEnlistmentRecoveryFilePath, - new RemoteInvokeOptions { ExpectedExitCode = 42 })) + // Bound the child process lifetime so that if MSDTC is unresponsive + // and the process hangs, Dispose() will kill it instead of blocking indefinitely. + new RemoteInvokeOptions { ExpectedExitCode = 42, TimeOut = 120_000 })) { // Wait for the external process to enlist in the transaction, it will signal this EventWaitHandle. Assert.True(waitHandle.WaitOne(Timeout));