File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,12 @@ Describe PSParallelPipeline {
137137
138138 Context ' TimeoutSeconds Parameter' {
139139 It ' Stops processing after the specified seconds' {
140+ $wait = 5
141+ if (-not $IsCoreCLR ) {
142+ # because pwsh 5.1 fucking sucks!
143+ $wait = 10
144+ }
145+
140146 Assert-RunspaceCount {
141147 $timer = [Stopwatch ]::StartNew()
142148 {
@@ -150,7 +156,7 @@ Describe PSParallelPipeline {
150156 } | Should - Throw - ExceptionType ([TimeoutException ])
151157 $timer.Stop ()
152158 $timer.Elapsed | Should - BeLessOrEqual ([timespan ]::FromSeconds(2.2 ))
153- }
159+ } - WaitSeconds $wait
154160 }
155161 }
156162
Original file line number Diff line number Diff line change @@ -20,15 +20,18 @@ function Assert-RunspaceCount {
2020 [CmdletBinding ()]
2121 param (
2222 [Parameter (Mandatory )]
23- [scriptblock ] $ScriptBlock
23+ [scriptblock ] $ScriptBlock ,
24+
25+ [Parameter ()]
26+ [int ] $WaitSeconds = 5
2427 )
2528
2629 try {
2730 $count = @ (Get-Runspace ).Count
2831 & $ScriptBlock
2932 }
3033 finally {
31- Start-Sleep 5
34+ Start-Sleep $WaitSeconds
3235 Get-Runspace |
3336 Should - HaveCount $count - Because ' Runspaces should be correctly disposed'
3437 }
You can’t perform that action at this time.
0 commit comments