Skip to content

Fix New-PfbQuotaUser test hang on missing mandatory -UserName - #13

Merged
dmann000 merged 1 commit into
dmann000:mainfrom
juemerson-at-purestorage:fix/quotauser-test-hang-prompt
Jul 20, 2026
Merged

Fix New-PfbQuotaUser test hang on missing mandatory -UserName#13
dmann000 merged 1 commit into
dmann000:mainfrom
juemerson-at-purestorage:fix/quotauser-test-hang-prompt

Conversation

@juemerson-at-purestorage

Copy link
Copy Markdown
Collaborator

Summary

  • The "throws when neither -UserName nor -UserId is supplied" test in Tests/New-PfbQuotaUser.Tests.ps1 invoked the cmdlet with neither identity parameter. Since -UserName is Mandatory in the default (ByName) parameter set, PowerShell's own parameter binder can't resolve which set applies, falls back to the default, and then prompts interactively for the missing -UserName instead of letting the cmdlet's own code run — hanging forever with no TTY to answer it. Reproduced in both a real interactive terminal and a non-interactive test runner.
  • Replaced the invocation with a parameter-metadata check confirming -UserName and -UserId are each Mandatory in their own parameter sets, which proves the same "neither supplied" case is rejected without ever risking the hang.

Test plan

  • Invoke-Pester -Path Tests/New-PfbQuotaUser.Tests.ps1 — 7/7 pass, no hang
  • Verified against current main (rebased branch point)

🤖 Generated with Claude Code

The "throws when neither -UserName nor -UserId is supplied" test invoked the
cmdlet with neither identity parameter. Since -UserName is Mandatory in the
default ('ByName') parameter set, PowerShell's own parameter binder can't
resolve which set applies, falls back to the default, and then prompts
interactively for the missing -UserName instead of letting the cmdlet's own
code run -- hanging forever with no TTY to answer it (reproduced in both a
real interactive terminal and this suite's own non-interactive runner).

Replaced the invocation with a metadata check confirming -UserName and
-UserId are each Mandatory in their own parameter sets, which proves the same
"neither supplied" case is rejected without ever risking the hang.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dmann000
dmann000 merged commit 6bdda4d into dmann000:main Jul 20, 2026
4 checks passed
juemerson-at-purestorage pushed a commit to juemerson-at-purestorage/fb-powershell that referenced this pull request Jul 20, 2026
Removes Remove-PfbSession, New-PfbNetworkAccessPolicy, Remove-PfbNetworkAccessPolicy
- they modeled REST endpoints that never existed in any FlashBlade API version
(2.0-2.27) and always returned HTTP 405. Sessions are read-only; network-access
policies are a fixed built-in set (only their rules are mutable, already covered by
New-/Remove-PfbNetworkAccessRule). Nothing that worked stops working.

ModuleVersion 2.1.1 -> 2.1.2; manifest FunctionsToExport 526 -> 523; CHANGELOG +
ReleaseNotes updated. The ValidateSet/enum fixes (PRs dmann000#13-16) are already on main
and are folded into this 2.1.2 release note. Validated: Test-ModuleManifest OK (523
exports), Pester 154 passed / 0 failed / 2 skipped (pwsh 7, 24 suites).
juemerson-at-purestorage pushed a commit to juemerson-at-purestorage/fb-powershell that referenced this pull request Jul 22, 2026
…auser-test-hang-prompt

Fix New-PfbQuotaUser test hang on missing mandatory -UserName
juemerson-at-purestorage pushed a commit to juemerson-at-purestorage/fb-powershell that referenced this pull request Jul 22, 2026
Removes Remove-PfbSession, New-PfbNetworkAccessPolicy, Remove-PfbNetworkAccessPolicy
- they modeled REST endpoints that never existed in any FlashBlade API version
(2.0-2.27) and always returned HTTP 405. Sessions are read-only; network-access
policies are a fixed built-in set (only their rules are mutable, already covered by
New-/Remove-PfbNetworkAccessRule). Nothing that worked stops working.

ModuleVersion 2.1.1 -> 2.1.2; manifest FunctionsToExport 526 -> 523; CHANGELOG +
ReleaseNotes updated. The ValidateSet/enum fixes (PRs dmann000#13-16) are already on main
and are folded into this 2.1.2 release note. Validated: Test-ModuleManifest OK (523
exports), Pester 154 passed / 0 failed / 2 skipped (pwsh 7, 24 suites).
@juemerson-at-purestorage
juemerson-at-purestorage deleted the fix/quotauser-test-hang-prompt branch August 9, 2026 18:56
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