From f1595c4b31870764372fd16a7add07a0a2f3feef Mon Sep 17 00:00:00 2001 From: Frode Flaten <3436158+fflaten@users.noreply.github.com> Date: Mon, 25 Jul 2022 20:19:10 +0200 Subject: [PATCH] Fix test perf by stopping ongoing `write-progress` (#17749) --- .../Language/Scripting/ActionPreference.Tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 b/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 index 1188fe0d46..2f52765250 100644 --- a/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 +++ b/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 @@ -384,18 +384,18 @@ Describe 'ActionPreference.Break tests' -Tag 'CI' { Write-Debug -Message 'This is a debug message' Write-Information -MessageData 'This is an information message' Write-Progress -Activity 'This shows progress' + Write-Progress -Activity 'This shows progress' -Completed } Test-Break -WarningAction Break -InformationAction Break *>$null $WarningPreference = $VerbosePreference = $DebugPreference = $InformationPreference = $ProgressPreference = [System.Management.Automation.ActionPreference]::Break Test-Break *>$null } - $results = @(Test-Debugger -Scriptblock $testScript) } - It 'Should show 7 debugger commands were invoked' { + It 'Should show 8 debugger commands were invoked' { # When no debugger commands are provided, 'c' is invoked every time a breakpoint is hit - $results.Count | Should -Be 7 + $results.Count | Should -Be 8 } It 'Write-Warning should trigger a breakpoint from -WarningAction Break' {