Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/deploy_windows_runner_dogfood.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ try {
-AllowVersionMismatch:$AllowVersionMismatch
$candidateReadyObservation = $candidateReady.Observation
$null = Assert-CapturedPrimaryRunnerIdentity -Identity $newPrimary
if ((Get-PrimaryRunnerProcesses -ExactPath $RunnerPath).Count -ne 1) {
# Windows PowerShell 5.1 unwraps a single pipeline object, so a bare
# `(Get-PrimaryRunnerProcesses ...).Count` is `$null` for the healthy
# exactly-one case. Force array semantics before checking cardinality.
if (@(Get-PrimaryRunnerProcesses -ExactPath $RunnerPath).Count -ne 1) {
throw "New Runner did not remain the exactly-one primary Runner after readiness"
}

Expand Down
4 changes: 4 additions & 0 deletions scripts/test_windows_runner_readiness.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ $deployTokens = $null
$deployParseErrors = $null
$deployAst = [System.Management.Automation.Language.Parser]::ParseFile($deployPath, [ref]$deployTokens, [ref]$deployParseErrors)
Assert-Equal 0 @($deployParseErrors).Count "deployment helper parser errors"
# Windows PowerShell 5.1 unwraps a one-item pipeline result to a scalar.
# The final local exactly-one-primary proof must therefore force array semantics;
# otherwise the healthy one-primary case observes `$null` for `.Count` and rolls back.
Assert-True ($deployAst.Extent.Text -match 'if\s*\(\s*@\(Get-PrimaryRunnerProcesses\s+-ExactPath\s+\$RunnerPath\)\.Count\s+-ne\s+1\s*\)') "deployment helper exactly-one primary recheck is not array-wrapped"
$allowVersionParameters = @($deployAst.ParamBlock.Parameters | Where-Object { $_.Name.VariablePath.UserPath -eq 'AllowVersionMismatch' })
Assert-Equal 1 $allowVersionParameters.Count "deployment helper does not expose exactly one AllowVersionMismatch opt-in"
$deployReadinessCalls = @($deployAst.FindAll({
Expand Down
Loading