test(server): cover Healthz notify path (MonitorHealthChan/notifyHealth) - #112
Merged
Conversation
Add internal unit tests for the health-signal broadcast path: - notifyHealth registers a receiver and closes/replaces a prior receiver registered for the same client address. - MonitorHealthChan fans a health code out to all registered notifiers and exits cleanly when its source channel is closed. These were previously at 40% (notifyHealth) and 0% (MonitorHealthChan) coverage; both are now fully covered. Test-only; no production change. Fixes #110 Signed-off-by: Michael Otteni <MichaelGOtteni@gmail.com>
The fan-out test registered only one notifier, so it never exercised the loop over the notifier registry with more than one entry. Register two notifiers and assert both receive the broadcast code. Signed-off-by: Michael Otteni <MichaelGOtteni@gmail.com>
rsperl
reviewed
Jun 1, 2026
The standalone registration test duplicated the replace test's setup without adding coverage. Fold it in by asserting the first notifier is registered before the second replaces it, which also makes the replace test's precondition explicit. Addresses review feedback on #112. Signed-off-by: Michael Otteni <MichaelGOtteni@gmail.com>
Contributor
|
@miotte - one more thing -- we discussed the need for having PR descriptions pretty short to keep the changelog manageable. I think the desc above could leave off the bullet points and below. Anything that's needed to explain the PR should be moved over to the ticket. |
rsperl
approved these changes
Jun 5, 2026
bithckr
approved these changes
Jun 10, 2026
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.
Fixes #110
Adds internal unit tests for the Healthz notify path:
notifyHealthreceiver registration/replacement andMonitorHealthChanfan-out + clean exit on channel close. Test-only, no production change.