Skip to content

test: fix 'channel closed' startup errors in partially connected network tests #2022

@sanity

Description

@sanity

Parent Issue

Part of #2021 - fixing ignored integration tests

Problem

Two test variants fail on startup with "channel closed" errors, preventing any test execution:

Affected tests:

  • apps/freenet-ping/app/tests/run_app_partially_connected_network.rs::test_ping_partially_connected_network
  • apps/freenet-ping/app/tests/run_app.rs::test_ping_partially_connected_network

Current status:

#[ignore = "Test has never worked - nodes fail on startup with channel closed errors"]

These tests have never worked since being committed, indicating a fundamental issue with node startup in partially connected topologies.

Test Description

The tests create a complex network topology:

  • Multiple gateway nodes (default: 3)
  • Multiple regular nodes (default: 7)
  • Controlled connectivity ratio between regular nodes
  • Deterministic approach to create partial connectivity

The goal is to verify subscription propagation in realistic, partially-connected networks.

Expected Behavior

Nodes should start up successfully and establish connections according to the configured topology, allowing the test to proceed to contract operations.

Actual Behavior

Nodes fail during startup with "channel closed" errors, causing the test to crash before any contract operations can be attempted.

Investigation Tasks

  • Run test locally and capture full error output with RUST_LOG=debug
  • Identify which channel is closing prematurely
  • Determine if issue is specific to partially connected topology or affects all multi-node tests
  • Check if recent fixes to connection management (if any) have addressed this
  • Verify if issue occurs with both gateway and regular nodes or just one type

Related Code

  • Test file: apps/freenet-ping/app/tests/run_app_partially_connected_network.rs
  • Duplicate test: apps/freenet-ping/app/tests/run_app.rs:1523
  • Network setup: Uses base_node_test_config with blocked addresses

Success Criteria

  • Nodes start successfully in partially connected topology
  • Test runs to completion (may reveal other issues)
  • Remove #[ignore] annotation
  • Test passes in CI

Impact

High priority - this test has never worked, suggesting a fundamental bug in connection handling for complex topologies that may affect production deployments.

[AI-assisted debugging and comment]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-developer-xpArea: developer experienceA-networkingArea: Networking, ring protocol, peer discoveryE-mediumExperience needed to fix/implement: Medium / intermediateP-highHigh priorityS-needs-reproductionStatus: Bug needs reproduction steps or confirmationT-bugType: Something is broken

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions