Skip to content

fix: remove references to deleted ConnectionHealth API in tests#37

Merged
mickvandijke merged 1 commit into
mainfrom
fix/remove-deleted-connection-health-refs
Apr 4, 2026
Merged

fix: remove references to deleted ConnectionHealth API in tests#37
mickvandijke merged 1 commit into
mainfrom
fix/remove-deleted-connection-health-refs

Conversation

@mickvandijke
Copy link
Copy Markdown
Collaborator

@mickvandijke mickvandijke commented Apr 4, 2026

Summary

  • Remove references to deleted ConnectionHealth enum and connection_health() method from test files
  • Replace health-check assertions with simpler is_connected() checks
  • Rename tests to reflect the updated API (test_connection_status instead of test_connection_health_status)

Test plan

  • cargo nextest run simultaneous_connect_dedup passes
  • cargo nextest run constrained_integration passes

🤖 Generated with Claude Code

Greptile Summary

This PR cleans up test files by removing all references to the deleted ConnectionHealth API and PeerConnection health-tracking fields, replacing them with the existing is_connected() method. The changes are mechanical and correct — ConnectionHealth no longer exists in the codebase, is_connected() is a valid drop-in for the simpler assertions, and PeerConnection no longer has last_health_ping_sent/last_health_pong_received fields. As a side effect, removing the 35-second health-cycle sleep from test_connection_status meaningfully 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

Filename Overview
tests/simultaneous_connect_dedup.rs Removes ConnectionHealth import/usage, replaces connection_health() with is_connected() checks; renames tests; removes 35s health-cycle sleep, speeding up CI
tests/constrained_integration.rs Removes deleted last_health_ping_sent and last_health_pong_received fields from PeerConnection struct initializations in tests

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]
Loading

Reviews (1): Last reviewed commit: "fix: remove references to deleted Connec..." | Re-trigger Greptile

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>
@mickvandijke mickvandijke merged commit 421cfcc into main Apr 4, 2026
36 of 37 checks passed
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