diff --git a/test/powershell/Common/Test.Helpers.psm1 b/test/powershell/Common/Test.Helpers.psm1 index 4a25ff88fb..688e4e0e09 100644 --- a/test/powershell/Common/Test.Helpers.psm1 +++ b/test/powershell/Common/Test.Helpers.psm1 @@ -1,4 +1,4 @@ -function Wait-CompleteExecution +function Wait-UntilTrue { [CmdletBinding()] param ( @@ -66,5 +66,5 @@ function ShouldBeErrorId } } -export-modulemember -function Wait-CompleteExecution,Test-IsElevated, ShouldBeErrorId +export-modulemember -function Wait-UntilTrue,Test-IsElevated, ShouldBeErrorId diff --git a/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 index cdfc008891..3727ce4f8e 100644 --- a/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 @@ -58,7 +58,7 @@ Describe "It should be possible to reset runspace debugging" -tag "Feature" { # Run script file until breakpoint hit. $ar = $ps.AddScript("$scriptPath").BeginInvoke() - $completed = Wait-CompleteExecution { $rs.Debugger.InBreakPoint -eq $true } -timeout 10000 -interval 200 + $completed = Wait-UntilTrue { $rs.Debugger.InBreakPoint -eq $true } -timeout 10000 -interval 200 $ps.Stop() $rs.ResetRunspaceState() } diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 index 6bd8faffcd..8e3f21c850 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 @@ -23,7 +23,7 @@ Describe 'native commands lifecycle' -tags 'Feature' { # waiting 30 seconds, because powershell startup time could be long on the slow machines, # such as CI - Wait-CompleteExecution { $rs.RunspaceAvailability -eq 'Available' } -timeout 30000 -interval 100 | Should Be $true + Wait-UntilTrue { $rs.RunspaceAvailability -eq 'Available' } -timeout 30000 -interval 100 | Should Be $true $ps.Stop() $rs.ResetRunspaceState()