Skip to content

Don't warn when a TestRegistry retry recovers - #2983

Open
nohwnd wants to merge 1 commit into
mainfrom
testregistry-retry-warning
Open

Don't warn when a TestRegistry retry recovers#2983
nohwnd wants to merge 1 commit into
mainfrom
testregistry-retry-warning

Conversation

@nohwnd

@nohwnd nohwnd commented Aug 15, 2026

Copy link
Copy Markdown
Member

Invoke-TestRegistryWithRetry writes the warning before it retries, so a run prints IO exception during a TestRegistry operation, retrying. even when the retry recovers and there is nothing for the user to act on. The operations it wraps (Test-Path, New-Item) are idempotent, and when the retry fails the exception propagates and that is the real signal. So the warning is noise in both outcomes.

Made it a Write-PesterDebugMessage -Scope Runtime instead.

Added a test that a recovered retry writes no warning. It fails without the change (5/6) and passes with it (6/6). Whole file green on PS 7.5.5 on macOS.

🤖

The warning was written before the retry ran, so it printed even when the retry
recovered and there was nothing for the user to act on. The wrapped operations
(Test-Path, New-Item) are idempotent, and when the retry fails the exception
propagates and that is the real signal, so the warning is noise either way.
Made it a debug message under the Runtime scope.

🤖
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.

1 participant