diff --git a/tests/fsharpqa/Source/CodeGen/Structure/DoNotInlineX.fs b/tests/fsharpqa/Source/CodeGen/Structure/DoNotInlineX.fs index 058daf81589520ac7dac127dce1941813004fa28..6c4a6447ee540c94f73a0aa8240d4e649bebdddf 100644 --- a/tests/fsharpqa/Source/CodeGen/Structure/DoNotInlineX.fs +++ b/tests/fsharpqa/Source/CodeGen/Structure/DoNotInlineX.fs @@ -4,6 +4,8 @@ open System open System.Diagnostics open System.IO +let longtime = int(System.TimeSpan.FromSeconds(30.0).TotalMilliseconds) // longtime is 30 seconds + let programFiles = let pf86 = Environment.GetEnvironmentVariable("ProgramFiles(x86)") if String.IsNullOrEmpty(pf86) then Environment.GetEnvironmentVariable("ProgramFiles") else pf86 @@ -26,7 +28,7 @@ let start (p1 : string) = Process.Start(p1) let CompileFile file args = let p = Process.Start(fsc, file + " " + args) - while not (p.HasExited) do () + p.WaitForExit() [] let main (args : string[]) = @@ -40,13 +42,13 @@ let main (args : string[]) = printfn "Compiled DerivedType with %A" derivedFlag let r1 = start "DerivedType.exe" - while not r1.HasExited do () + r1.WaitForExit(longtime) printfn "Ran DerivedType.exe with result: %A" r1.ExitCode CompileFile "BaseType.fs" "-a" printfn "Compiled BaseType without %A" baseFlag let r2 = start "DerivedType.exe" - while not r2.HasExited do () + r2.WaitForExit(longtime) printfn "Ran DerivedType.exe with result: %A" r2.ExitCode if r1.ExitCode = expectedResult1 && r2.ExitCode = expectedResult2 then 0 else 1 diff --git a/tests/service/FscTests.fs b/tests/service/FscTests.fs index 97f1ee759226f2eb4aa4007959799454dbe38c65..ca3d3999e0a5edbe75fe0596c7806a075109a661 100644 --- a/tests/service/FscTests.fs +++ b/tests/service/FscTests.fs @@ -76,6 +76,8 @@ type PEVerifier () = #endif static let execute (fileName : string, arguments : string) = + // Peverify may run quite a while some assemblies are pretty big. Make the timeout 3 minutes just in case. + let longtime = int (TimeSpan.FromMinutes(3.0).TotalMilliseconds) printfn "executing '%s' with arguments %s" fileName arguments let psi = new ProcessStartInfo(fileName, arguments) psi.UseShellExecute <- false @@ -87,7 +89,7 @@ type PEVerifier () = use proc = Process.Start(psi) let stdOut = proc.StandardOutput.ReadToEnd() let stdErr = proc.StandardError.ReadToEnd() - while not proc.HasExited do () + proc.WaitForExit(longtime) proc.ExitCode, stdOut, stdErr member __.Verify(assemblyPath : string) =