win_wait_for: fix tests after attempts change (#35026)

This commit is contained in:
Jordan Borean
2018-01-18 14:15:54 +10:00
committed by GitHub
parent f0134079e3
commit 630ae01f91
3 changed files with 24 additions and 24 deletions

View File

@@ -136,7 +136,7 @@ if ($path -eq $null -and $port -eq $null -and $state -eq "drained") {
if ($complete -eq $false) {
$elapsed_seconds = ((Get-Date) - $module_start).TotalSeconds
$result.attempts = $attempts
$result.wait_attempts = $attempts
$result.elapsed = $elapsed_seconds
if ($search_regex -eq $null) {
Fail-Json $result "timeout while waiting for file $path to be present"
@@ -168,7 +168,7 @@ if ($path -eq $null -and $port -eq $null -and $state -eq "drained") {
if ($complete -eq $false) {
$elapsed_seconds = ((Get-Date) - $module_start).TotalSeconds
$result.attempts = $attempts
$result.wait_attempts = $attempts
$result.elapsed = $elapsed_seconds
if ($search_regex -eq $null) {
Fail-Json $result "timeout while waiting for file $path to be absent"
@@ -195,7 +195,7 @@ if ($path -eq $null -and $port -eq $null -and $state -eq "drained") {
if ($complete -eq $false) {
$elapsed_seconds = ((Get-Date) - $module_start).TotalSeconds
$result.attempts = $attempts
$result.wait_attempts = $attempts
$result.elapsed = $elapsed_seconds
Fail-Json $result "timeout while waiting for $($hostname):$port to start listening"
}
@@ -216,7 +216,7 @@ if ($path -eq $null -and $port -eq $null -and $state -eq "drained") {
if ($complete -eq $false) {
$elapsed_seconds = ((Get-Date) - $module_start).TotalSeconds
$result.attempts = $attempts
$result.wait_attempts = $attempts
$result.elapsed = $elapsed_seconds
Fail-Json $result "timeout while waiting for $($hostname):$port to stop listening"
}
@@ -257,14 +257,14 @@ if ($path -eq $null -and $port -eq $null -and $state -eq "drained") {
if ($complete -eq $false) {
$elapsed_seconds = ((Get-Date) - $module_start).TotalSeconds
$result.attempts = $attempts
$result.wait_attempts = $attempts
$result.elapsed = $elapsed_seconds
Fail-Json $result "timeout while waiting for $($hostname):$port to drain"
}
}
}
$result.attempts = $attempts
$result.wait_attempts = $attempts
$result.elapsed = ((Get-Date) - $module_start).TotalSeconds
Exit-Json $result

View File

@@ -127,7 +127,7 @@ EXAMPLES = r'''
'''
RETURN = r'''
attempts:
wait_attempts:
description: The number of attempts to poll the file or port before module
finishes.
returned: always