Skip to content

test: fix flaky Update-PiHoleClient tests missing a create-settle delay - #126

Merged
mikemadeja merged 1 commit into
developfrom
test/fix-client-update-flakiness
Sep 29, 2026
Merged

mikemadeja merged 1 commit into
developfrom
test/fix-client-update-flakiness

Conversation

@mikemadeja

Copy link
Copy Markdown
Owner

Summary

  • tests/ClientManagement/Update-PiHoleClient.Integration.Tests.ps1 has failed intermittently in CI three times in a row across recent builds (#343, #347, #350), always in this same file, always with either a 400 on the Update-PiHoleClient call itself or a cascading "already exists" on the next test's New-PiHoleClient call.
  • Root cause: every It block calls New-PiHoleClient immediately followed by Update-PiHoleClient with 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 in tools/Update-ExampleOutput.ps1 for Lists/Domains/Groups, but this test file never got the same fix when it was written.
  • Adds a short Start-Sleep -Seconds 2 between each New-PiHoleClient call and the Update-PiHoleClient call that depends on it (6 of the file's 7 tests).

Test plan

  • Ran this test file against the real server after the fix: clean 7/7 pass (previously failing 3/3 times without it).
  • No production code touched - test file only.

🤖 Generated with Claude Code

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>
@mikemadeja
mikemadeja merged commit 0dbbc4d into develop Sep 29, 2026
3 checks passed
@mikemadeja mikemadeja mentioned this pull request Sep 29, 2026
1 task done
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