Audit finding from #300 (commit 679f9fe)
Severity: high
Category: test coverage
File: crates/network (esp. iroh.rs with only 2 tests)
Obvious fix: no (requires real or harnessed iroh endpoints; some plumbing needed)
Description
The network crate is 1407 SLOC with only 18 tests, ratio 0.0128 — second-worst in the workspace. The breakdown is topics.rs:5, iroh.rs:2, mem.rs:11, meaning the real iroh-backed transport (the production path) has just 2 tests while the in-memory mock has 11. Most coverage is exercising the mock, not the wire.
Impact / Threat
Regressions in the production iroh path are unlikely to be caught at the crate level.
Suggested fix
Add tests for these named behaviors:
iroh peer dial + handshake: spin up two in-process iroh endpoints, dial, exchange one message both ways, assert both peers see the connection-established event.
- Topic subscription fan-out: subscribe N peers to a topic, publish from one, assert all N receive exactly once and non-subscribers receive nothing.
- Reconnect / disconnect semantics: drop one side of an established connection, assert the surviving side observes a disconnect within a bounded time and that subsequent sends fail with a typed error rather than block.
Verify
rg -c '#\[(tokio::|wasm_bindgen_)?test\]' crates/network/
find crates/network/src -name '*.rs' | xargs wc -l | tail -1
Audit finding from #300 (commit 679f9fe)
Severity: high
Category: test coverage
File: crates/network (esp.
iroh.rswith only 2 tests)Obvious fix: no (requires real or harnessed iroh endpoints; some plumbing needed)
Description
The
networkcrate is 1407 SLOC with only 18 tests, ratio 0.0128 — second-worst in the workspace. The breakdown istopics.rs:5,iroh.rs:2,mem.rs:11, meaning the real iroh-backed transport (the production path) has just 2 tests while the in-memory mock has 11. Most coverage is exercising the mock, not the wire.Impact / Threat
Regressions in the production iroh path are unlikely to be caught at the crate level.
Suggested fix
Add tests for these named behaviors:
irohpeer dial + handshake: spin up two in-process iroh endpoints, dial, exchange one message both ways, assert both peers see the connection-established event.Verify