test: fix flaky Update-PiHoleClient tests missing a create-settle delay - #126
Merged
Merged
Conversation
This test file's Update-PiHoleClient tests were failing intermittently in CI (3 times in a row across recent builds) with either a 400 on the Update-PiHoleClient call itself or a cascading "already exists" on the next test's New-PiHoleClient call. Every It block calls New-PiHoleClient immediately followed by Update-PiHoleClient with zero delay between them - the real Pi Zero W test server needs a moment to make a just-created client queryable/updatable again, the same known hardware limitation already worked around in tools/Update-ExampleOutput.ps1 for Lists/Domains/Groups, but this test file never got the same fix. Verified with a clean 7/7 pass against the real server after adding a short Start-Sleep between each New-PiHoleClient and the Update-PiHoleClient call that depends on it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/ClientManagement/Update-PiHoleClient.Integration.Tests.ps1has failed intermittently in CI three times in a row across recent builds (#343, #347, #350), always in this same file, always with either a400on theUpdate-PiHoleClientcall itself or a cascading"already exists"on the next test'sNew-PiHoleClientcall.Itblock callsNew-PiHoleClientimmediately followed byUpdate-PiHoleClientwith zero delay. The real Pi Zero W test server needs a moment to make a just-created client queryable/updatable again - the same known hardware limitation already worked around intools/Update-ExampleOutput.ps1for Lists/Domains/Groups, but this test file never got the same fix when it was written.Start-Sleep -Seconds 2between eachNew-PiHoleClientcall and theUpdate-PiHoleClientcall that depends on it (6 of the file's 7 tests).Test plan
🤖 Generated with Claude Code