Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc0b044c

Browse files
authored
Use WaitForExit(timeout) rather than loop on HasExited property for some tests (#3906)
* bump* Remove reliance on HasExited, instead use WaitForExit(timeout)* Huge timeout in fcs tests* Remove bump space* Replace scary computed constants with hipster TimeSpans* fix comment* Of course TotalMilliseconds is float and Milliseconds is int --- use Milliseconds* Use the Timespan APIs correctly
1 parente600412 commitc0b044c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

‎tests/fsharpqa/Source/CodeGen/Structure/DoNotInlineX.fs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ open System
44
openSystem.Diagnostics
55
openSystem.IO
66

7+
letlongtime= int(System.TimeSpan.FromSeconds(30.0).TotalMilliseconds)// longtime is 30 seconds
8+
79
letprogramFiles=
810
letpf86= Environment.GetEnvironmentVariable("ProgramFiles(x86)")
911
if String.IsNullOrEmpty(pf86)then Environment.GetEnvironmentVariable("ProgramFiles")else pf86
@@ -26,7 +28,7 @@ let start (p1 : string) = Process.Start(p1)
2628

2729
letCompileFile file args=
2830
letp= Process.Start(fsc, file+""+ args)
29-
whilenot(p.HasExited)do()
31+
p.WaitForExit()
3032

3133
[<EntryPoint>]
3234
letmain(args:string[])=
@@ -40,13 +42,13 @@ let main (args : string[]) =
4042
printfn"Compiled DerivedType with%A" derivedFlag
4143

4244
letr1= start"DerivedType.exe"
43-
whilenotr1.HasExiteddo()
45+
r1.WaitForExit(longtime)
4446
printfn"Ran DerivedType.exe with result:%A" r1.ExitCode
4547

4648
CompileFile"BaseType.fs""-a"
4749
printfn"Compiled BaseType without%A" baseFlag
4850
letr2= start"DerivedType.exe"
49-
whilenotr2.HasExiteddo()
51+
r2.WaitForExit(longtime)
5052
printfn"Ran DerivedType.exe with result:%A" r2.ExitCode
5153

5254
if r1.ExitCode= expectedResult1&& r2.ExitCode= expectedResult2then0else1

‎tests/service/FscTests.fs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ type PEVerifier () =
7676
#endif
7777

7878
static letexecute(fileName:string,arguments:string)=
79+
// Peverify may run quite a while some assemblies are pretty big. Make the timeout 3 minutes just in case.
80+
letlongtime= int(TimeSpan.FromMinutes(3.0).TotalMilliseconds)
7981
printfn"executing '%s' with arguments%s" fileName arguments
8082
letpsi=new ProcessStartInfo(fileName, arguments)
8183
psi.UseShellExecute<-false
@@ -87,7 +89,7 @@ type PEVerifier () =
8789
use proc= Process.Start(psi)
8890
letstdOut= proc.StandardOutput.ReadToEnd()
8991
letstdErr= proc.StandardError.ReadToEnd()
90-
whilenotproc.HasExiteddo()
92+
proc.WaitForExit(longtime)
9193
proc.ExitCode, stdOut, stdErr
9294

9395
member__.Verify(assemblyPath:string)=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp