fix: remove references to deleted ConnectionHealth API in tests#37
Merged
Merged
Conversation
Tests were using ConnectionHealth enum and connection_health() method that were removed from PeerConnection/Node. Rewrote health tests to use is_connected() and removed stale health ping/pong fields from struct literals. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
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
ConnectionHealthenum andconnection_health()method from test filesis_connected()checkstest_connection_statusinstead oftest_connection_health_status)Test plan
cargo nextest run simultaneous_connect_deduppassescargo nextest run constrained_integrationpasses🤖 Generated with Claude Code
Greptile Summary
This PR cleans up test files by removing all references to the deleted
ConnectionHealthAPI andPeerConnectionhealth-tracking fields, replacing them with the existingis_connected()method. The changes are mechanical and correct —ConnectionHealthno longer exists in the codebase,is_connected()is a valid drop-in for the simpler assertions, andPeerConnectionno longer haslast_health_ping_sent/last_health_pong_receivedfields. As a side effect, removing the 35-second health-cycle sleep fromtest_connection_statusmeaningfully reduces test suite runtime.Confidence Score: 5/5
Safe to merge — purely removes deleted API references and replaces with correct, verified alternatives
All changes are mechanical removals of a deleted API. The replacement is_connected() method exists, works correctly, and disconnect() synchronously removes peers before returning so there are no race conditions in the refactored tests. No P0 or P1 issues found.
No files require special attention
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Create node_a and node_b] --> B[node_a.connect_addr to node_b] B --> C[node_a.is_connected?] C -->|true ✓| D[Assert connected_peers == 1] D --> E[Shutdown nodes] C -->|false ✗| F[Test FAILS] G[Disconnect flow] --> H[node_a.disconnect] H --> I[Peers map updated synchronously] I --> J[node_a.is_connected?] J -->|false ✓| K[Test PASSES] J -->|true ✗| L[Test FAILS]Reviews (1): Last reviewed commit: "fix: remove references to deleted Connec..." | Re-trigger Greptile