test: poll cluster status for node B online instead of asserting instantly

The join task completing does not mean corosync membership has reached
the status endpoint; the instant assertion failed intermittently (runs
159 and 169) while every other cluster check passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
goodolclint-claude[bot]
2026-08-31 23:00:49 +00:00
committed by GitHub
parent 341f79e7ac
commit f758275668
@@ -205,11 +205,18 @@ Describe 'Cluster Config & HA Lifecycle — Integration' -Tag 'Integration' {
if (Skip-IfNoNodeB) { return }
if (Skip-IfNoCluster) { return }
$status = Get-PveClusterStatus -ErrorAction Stop
$nodeEntries = @($status) | Where-Object { $_.Type -eq 'node' }
@($nodeEntries).Count | Should -BeGreaterOrEqual 2
# Corosync membership reaches the status endpoint seconds after
# the join task completes — poll rather than assert instantly.
$deadline = [DateTime]::UtcNow.AddSeconds(60)
do {
$status = Get-PveClusterStatus -ErrorAction Stop
$nodeEntries = @($status) | Where-Object { $_.Type -eq 'node' }
$onlineNodes = @($nodeEntries) | Where-Object { $_.Online -eq 1 }
if (@($onlineNodes).Count -ge 2) { break }
Start-Sleep -Seconds 3
} while ([DateTime]::UtcNow -lt $deadline)
$onlineNodes = @($nodeEntries) | Where-Object { $_.Online -eq 1 }
@($nodeEntries).Count | Should -BeGreaterOrEqual 2
@($onlineNodes).Count | Should -BeGreaterOrEqual 2
}
}