- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 105
 
Description
Problem
The multi-gateway variant of the partially connected network test fails in CI with "channel closed" errors during gateway startup, despite passing consistently in local testing.
Background
This issue was discovered while working on #2022 to fix partially connected network tests. The primary blocker (missing contract feature flag) has been resolved, which enabled the single-gateway test variant to pass reliably. However, the multi-gateway variant exhibits CI-specific failures.
Test Details
- Single-gateway test (
run_app_partially_connected_network.rs): 1 gateway, 7 nodes - ✅ Works reliably in both local and CI - Multi-gateway test (
run_app.rs): 3 gateways, 7 nodes - ❌ Fails in CI, passes locally 
Error Pattern
CI failure logs show:
ERROR freenet::operations::connect: Failed while attempting connection to gateway, 
  gateway: v6MWKgqJ66B21v7a, error: failed notifying, channel closed
Gateway node failed: channel closed
The error occurs during gateway initialization (within ~90 seconds), not during the test logic execution.
Observations
- Works locally: Test passes consistently on local development machines
 - Fails in CI: GitHub Actions environment shows gateway coordination failures
 - Timing dependency: Increasing initialization delays (2s → 10s) did not resolve the issue
 - Gateway-specific: Only affects tests with multiple (3+) gateways
 
Root Cause Hypothesis
The multi-gateway test appears to have a race condition or resource coordination issue when multiple gateways attempt to initialize simultaneously in resource-constrained CI environments. The failure pattern suggests:
- Gateways successfully start but internal channels close unexpectedly
 - Possible issue with gateway peer discovery/handshake coordination
 - May be related to gateway-to-gateway communication timing
 
Investigation Needed
- Gateway initialization logic: Review how multiple gateways coordinate during startup
 - Channel lifecycle: Investigate why gateway internal channels close prematurely in CI
 - Resource constraints: Determine if CI environment limitations trigger the issue
 - Test architecture: Consider if test setup needs modification for multi-gateway scenarios
 
Workaround
The test is currently marked as #[ignore] with reference to this issue. The single-gateway variant provides partial test coverage for partially connected network functionality.
Files
apps/freenet-ping/app/tests/run_app.rs- Multi-gateway test (currently ignored)apps/freenet-ping/app/tests/run_app_partially_connected_network.rs- Single-gateway test (working)
Related
- test: fix 'channel closed' startup errors in partially connected network tests #2022 - Parent issue for fixing ignored integration tests (partially addressed)
 - PR fix: enable freenet-stdlib contract feature and fix partially connected network tests #2028 - Fixes contract feature flag and enables single-gateway test
 
Acceptance Criteria
- Multi-gateway test passes reliably in CI
 - Understanding of why CI environment behaves differently than local
 -  Remove 
#[ignore]annotation from test - Document any necessary test setup changes for multi-gateway scenarios
 
[AI-assisted issue creation]
Metadata
Metadata
Assignees
Labels
Type
Projects
Status