From 684a25b9eab16de61f70b4c676d6df1fbb79af26 Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Mon, 9 Jan 2017 20:49:42 -0800 Subject: [PATCH] Fix Wait-CompleteExecution usage --- .../NativeExecution/NativeCommandProcessor.Tests.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 index 5b7b553e1f..6bd8faffcd 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 @@ -12,18 +12,18 @@ Describe 'native commands lifecycle' -tags 'Feature' { It "native | ps | native doesn't block" { $iss = [initialsessionstate]::CreateDefault2(); $rs = [runspacefactory]::CreateRunspace($iss) - $rs.Name = "TestRunspaceDebuggerReset" $rs.Open() $ps = [powershell]::Create() $ps.Runspace = $rs + $ps.AddScript("& $powershell -noprofile -command '100; + Start-Sleep -Seconds 100' | + %{ if (`$_ -eq 100) { 'foo'; exit; }}").BeginInvoke() + # waiting 30 seconds, because powershell startup time could be long on the slow machines, # such as CI - Wait-CompleteExecution { - $ps.AddScript("& $powershell -noprofile -command '100; Start-Sleep -Seconds 100' | - %{ if (`$_ -eq 100) { 'foo'; exit; }}").Invoke() - } -timeout 30000 -interval 100 | Should Be $true + Wait-CompleteExecution { $rs.RunspaceAvailability -eq 'Available' } -timeout 30000 -interval 100 | Should Be $true $ps.Stop() $rs.ResetRunspaceState()