From 5eabd27e1af2827228b1ed925664bc15d9035484 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 7 May 2020 21:34:09 -0400 Subject: Fix timeout Increase WixNative*.exe timeout to 10 minutes and properly handle when there's a timeout. --- src/WixToolset.Core.Native/WixNativeExe.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Core.Native/WixNativeExe.cs b/src/WixToolset.Core.Native/WixNativeExe.cs index 994fc7ec..afa2ed7c 100644 --- a/src/WixToolset.Core.Native/WixNativeExe.cs +++ b/src/WixToolset.Core.Native/WixNativeExe.cs @@ -11,7 +11,7 @@ namespace WixToolset.Core.Native internal class WixNativeExe { - private const int FiveMinutesInMilliseconds = 300000; + private const int TenMinutesInMilliseconds = 600000; private static string PathToWixNativeExe; private readonly string commandLine; @@ -63,17 +63,22 @@ namespace WixToolset.Core.Native process.StandardInput.WriteLine(); } - if (process.WaitForExit(FiveMinutesInMilliseconds)) + if (process.WaitForExit(TenMinutesInMilliseconds)) { // If the process successfully exits documentation says we need to wait again // without a timeout to ensure that all of the redirected output is captured. // process.WaitForExit(); - } - if (process.ExitCode != 0) + if (process.ExitCode != 0) + { + throw new Win32Exception(process.ExitCode); + } + } + else { - throw new Win32Exception(process.ExitCode); + process.Kill(); + throw new Win32Exception(1460/*ERROR_TIMEOUT*/); } } -- cgit v1.2.3-55-g6feb