Skip to content

ci-azure - Skip the Windows SSPI test when the build exits early - #10515

Merged
potatoqualitee merged 1 commit into
developmentfrom
fix/sspi-skip-on-early-exit
Aug 4, 2026
Merged

ci-azure - Skip the Windows SSPI test when the build exits early#10515
potatoqualitee merged 1 commit into
developmentfrom
fix/sspi-skip-on-early-exit

Conversation

@potatoqualitee

Copy link
Copy Markdown
Member

The intermittent SSPI failure (example)

The Run PowerShell 7 Windows SSPI integration test step fails only sometimes, and the pattern finally fell out of the logs:

  1. On PR events, DBATOOLS_COMMIT_MESSAGE falls back to the PR title. When a title carries a (do ...) marker (like Copy-DbaDatabase - Fix empty -NewName destination sweep and piped multi-database failures #10514's did), the run is scoped.
  2. If that scope leaves the SINGLE 1/5 partition with zero tests, appveyor.prep exits early without installing the pinned dbatools.library: appveyor.prep: exit early without provisioning (no tests to run).
  3. The SSPI steps are gated only on scenario == SINGLE && part == 1/5 plus test-file presence, so they still run. Under pwsh 7 the dbatools.psd1 import fails (required module unresolvable), Invoke-ManualPester falls back to the psm1 import, and that loads whatever stale dbatools.library the reused runner has lying around. If that build predates NetworkCredentialSspiContextProvider, the test's type guard throws.

Green vs. red depends on which runner the job lands on and what a previous job left in Program Files, which is why it looked random. Full runs (development pushes, unscoped PRs) always install the pinned library first, so they always pass.

Fix

Both SSPI steps now honor C:\Temp\gha-exit-build.flag — the exact flag Exit-AppveyorBuild drops for the later pipeline stages to skip on. The shim deletes it at the start of every job's pipeline step, so the flag state is always this job's own.

Validation

This PR's title deliberately carries the same (do ...) scope as #10514 (normally PR titles shouldn't, but this PR changes no commands, so the title is the only way to reproduce the trigger). The workflow-only diff means changed-file detection narrows nothing, the title scope empties SINGLE 1/5, prep early-exits, and the SSPI step must log CI pipeline exited early without provisioning, skipping. and stay green — the exact A/B of the failing run.

🤖 Generated with Claude Code

…out provisioning

When the scoped test selection leaves the SINGLE 1/5 partition empty,
appveyor.prep exits early without installing the pinned dbatools.library.
The SSPI steps still ran and loaded whatever stale library the reused
runner had, failing whenever that build predates
NetworkCredentialSspiContextProvider. Honor the shim's early-exit flag.

(do Copy-DbaDatabase, Test-DbaPath, Test-DbaBackupInformation)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@potatoqualitee potatoqualitee changed the title ci-azure - Skip the Windows SSPI test when the build exits early (do Copy-DbaDatabase, Test-DbaPath, Test-DbaBackupInformation) ci-azure - Skip the Windows SSPI test when the build exits early Aug 4, 2026
@potatoqualitee
potatoqualitee merged commit 2b269da into development Aug 4, 2026
25 checks passed
@potatoqualitee
potatoqualitee deleted the fix/sspi-skip-on-early-exit branch August 4, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants