You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[TEST-03] relay crate thinly tested for a network-exposed component #341
Severity: medium Category: test coverage File: crates/relay Obvious fix: yes
Description
The relay crate is 994 SLOC with 16 tests (ratio 0.0161). 9 of those live in tests/bootstrap_endpoint.rs and only 7 are inline in src/lib.rs. Because a relay is publicly reachable infrastructure, the low coverage here translates directly into operational risk (malformed input, eviction, auth boundaries).
Impact / Threat
Operational risk on a network-exposed component — malformed-input regressions, eviction policy bugs, and auth-boundary regressions can land undetected.
Suggested fix
Add tests for these named behaviors:
Reject malformed bootstrap request: send a frame with a truncated header / invalid varint and assert the relay closes the connection with a specific error code, never panics, and does not allocate unboundedly.
Per-peer connection cap: open more concurrent connections from a single source than the configured limit and assert excess connections are refused with the documented status while existing connections remain healthy.
Topic registry eviction: register topics until the relay's eviction threshold, then assert the LRU/aging policy actually drops the oldest entries and that a re-registration after eviction succeeds.
Activity