From f75827566862873740b36a74c5e4079e6ab0acb1 Mon Sep 17 00:00:00 2001 From: "goodolclint-claude[bot]" <323206664+goodolclint-claude[bot]@users.noreply.github.com> Date: Mon, 31 Aug 2026 23:00:49 +0000 Subject: [PATCH] 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 --- .../Integration/16_Cluster.Tests.ps1 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/PSProxmoxVE.Tests/Integration/16_Cluster.Tests.ps1 b/tests/PSProxmoxVE.Tests/Integration/16_Cluster.Tests.ps1 index 405ccc7..a14a26f 100644 --- a/tests/PSProxmoxVE.Tests/Integration/16_Cluster.Tests.ps1 +++ b/tests/PSProxmoxVE.Tests/Integration/16_Cluster.Tests.ps1 @@ -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 } }