From 2e98d8812d84aae0c4fca3846a6077ad459b06b5 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 2 Mar 2023 12:54:13 -0800 Subject: [PATCH] Increase the timeout when waiting for the event log (#19264) --- test/powershell/engine/Basic/GroupPolicySettings.Tests.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/powershell/engine/Basic/GroupPolicySettings.Tests.ps1 b/test/powershell/engine/Basic/GroupPolicySettings.Tests.ps1 index 44080453e90..79b94456544 100644 --- a/test/powershell/engine/Basic/GroupPolicySettings.Tests.ps1 +++ b/test/powershell/engine/Basic/GroupPolicySettings.Tests.ps1 @@ -85,7 +85,9 @@ Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows { Remove-Item $ModuleNamesKeyPath -Recurse -Force # usually event becomes visible in the log after ~500 ms # set timeout for 5 seconds - Wait-UntilTrue -sb { Get-WinEvent -FilterHashtable @{ ProviderName="PowerShellCore"; Id = 4103 } -MaxEvents 5 | ? {$_.Message.Contains($RareCommand)} } -TimeoutInMilliseconds (5*1000) -IntervalInMilliseconds 100 | Should -BeTrue + Wait-UntilTrue -sb { Get-WinEvent -FilterHashtable @{ ProviderName="PowerShellCore"; Id = 4103 } -MaxEvents 5 | + Where-Object {$_.Message.Contains($RareCommand)} } -TimeoutInMilliseconds (10*1000) -IntervalInMilliseconds 100 | + Should -BeTrue } $KeyPath = Join-Path $KeyRoot 'ModuleLogging'