test: cover the node status watcher under synctest - #753
Merged
Conversation
withActiveLock cancels the work when the lock expires and retries a lost election every keepalive/4; run reconnects after the connection timeout; replayDeadJournals keeps ticking past a service status error without a takeover; initNodeStatus handles only unavailable nodes, at most nodeStatusHandlers at a time, and stops on a store error; monitor returns when the stream closes or the context ends; dealNodeStatusMessage sets workloads down only for dead nodes.
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.
Test debt from the 2026-09 audit: the node status watcher had one test. These run it under
testing/synctest, so the election retry, the keepalive expiry and the reconnect timer are exercised on the fake clock:withActiveLockcancels the work when the ephemeral lock expires and unregisters; a lost election is retried every keepalive/4 until it wins.runreconnects after the connection timeout and stops when the context ends.replayDeadJournalskeeps ticking past a service status error and never takes over on one.initNodeStatushandles only unavailable nodes, at mostnodeStatusHandlersat a time, and stops on a store error.monitorreturnsErrMessageChanClosedwhen the stream closes and the context error when it ends.dealNodeStatusMessagesets workloads down only for dead nodes: alive and broken messages are dropped, a failed SetNode is swallowed.RunNodeStatusWatcherreturns when the context ends.Tests only, no production change. Gates: build, vet, full tests, lint, fmt-check, asl on linux and darwin green.