Increase the timeout when waiting for the event log (#19264) (#19936)

Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
This commit is contained in:
Travis Plunk
2023-07-12 09:40:13 -07:00
committed by GitHub
co-authored by Dongbo Wang
parent 80cee3ec12
commit d1d8b65045
@@ -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'