fix(test): preserve singleton lifecycle samples

Keep one-item endpoint and checkpoint results as arrays under PowerShell strict mode so the uncapped reconnect session is validated by the same gate as the multi-checkpoint capped route.
This commit is contained in:
Erik 2026-07-20 23:54:58 +02:00
parent a4ef57885c
commit f7b09617c5

View file

@ -219,11 +219,12 @@ function Invoke-Session(
-RedirectStandardOutput $stdout -RedirectStandardError $stderr -PassThru -RedirectStandardOutput $stdout -RedirectStandardError $stderr -PassThru
Wait-ForPattern $client $stdout '[UI-PROBE] UI probe script complete' $SessionTimeoutSeconds Wait-ForPattern $client $stdout '[UI-PROBE] UI probe script complete' $SessionTimeoutSeconds
$clientPort = @(Get-NetUDPEndpoint -OwningProcess $client.Id -ErrorAction SilentlyContinue | $clientPorts = @(Get-NetUDPEndpoint -OwningProcess $client.Id -ErrorAction SilentlyContinue |
Select-Object -First 1 -ExpandProperty LocalPort) Select-Object -First 1 -ExpandProperty LocalPort)
if ($clientPort.Count -ne 1) { if ($clientPorts.Count -ne 1) {
throw "could not resolve the client's UDP endpoint for ACE disconnect verification" throw "could not resolve the client's UDP endpoint for ACE disconnect verification"
} }
$clientPort = [int]$clientPorts[0]
$client.Refresh() $client.Refresh()
$processSample = [pscustomobject][ordered]@{ $processSample = [pscustomobject][ordered]@{
@ -234,7 +235,7 @@ function Invoke-Session(
WindowTitle = $client.MainWindowTitle WindowTitle = $client.MainWindowTitle
} }
$checkpoints = Read-Checkpoints $timeline $checkpoints = @(Read-Checkpoints $timeline)
if ($checkpoints.Count -ne $ExpectedCheckpoints.Count) { if ($checkpoints.Count -ne $ExpectedCheckpoints.Count) {
$failures.Add("${Label}: expected $($ExpectedCheckpoints.Count) checkpoints, found $($checkpoints.Count)") $failures.Add("${Label}: expected $($ExpectedCheckpoints.Count) checkpoints, found $($checkpoints.Count)")
} }