Repository navigation
test(kademlia): re-enable TestClosestPeer and TestNotifierHooks - #5686
Merged
Merged
Conversation
TestClosestPeer panicked with index out of range when un-skipped: the node was never marked publicly reachable, so ClosestPeer did not consider self and the want-self case fell through to connectedPeers[-1]. Set the reachability in setup and assert errors explicitly, rather than ignoring them for cases that expect a peer. TestNotifierHooks passes unchanged, so only its skip is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sbackend123
approved these changes
Nov 4, 2026
martinconic
approved these changes
Nov 5, 2026
akrem-chabchoub
self-requested a review
November 5, 2026 08:35
akrem-chabchoub
approved these changes
Nov 5, 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.
Re-enables the two kademlia tests that were skipped with "disabled due to kademlia inconsistencies hotfix". Test-only change.
TestClosestPeerpanicked withindex out of range [-1]when un-skipped.ClosestPeeronly considers self when the node is publicly reachable, and the test never set that, so the want-self case got a peer and a nil error, then evaluatedconnectedPeers[-1].ReachabilityStatusPublicin setup.-1cases must now returnErrWantSelf, and any error in other cases fails the test instead of being ignored.TestNotifierHooksneeded no changes beyond removing the skip.Testing
TestClosestPeer: 20/20 plain and 50/50 with-race.TestNotifierHooks: 1,000 runs each of plain,-raceand-race -cpu 1, all passing.go test -race ./pkg/topology/kademlia/...,go vetandgolangci-lintpass on the package.Note: the original reason for the skips isn't documented (added in 5bacaf5). These tests passing doesn't show that the underlying "inconsistencies" are gone, and they use small static peer sets.
🤖 Generated with Claude Code