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(node): probe_read_timeout_resets_stream_with_zero_code exercises the accept_bi timeout, not PROBE_READ_TIMEOUT #2320
area:nodedecdn-node daemon: runtime, handlers, admin RPC, serve pathkind:bugSomething does not behave as documentedkind:testTest coverage, flakes, fixtures or the e2e harnessprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
crates/node/tests/probe_loopback.rs · probe_read_timeout_resets_stream_with_zero_code is meant to cover the probe handler's PROBE_READ_TIMEOUT path (crates/node/src/handlers/probe.rs, the timeout(PROBE_READ_TIMEOUT, read_frame(recv)) arm: reset(send, recv, APP_ERR_NO_ERROR), then conn.close(app_code, b"probe-error")). It does not reach that path.
The test calls client_conn.open_bi() and never writes. In noq 1.3.0, opening a stream sends nothing to the peer until data is written (noq-1.3.0/src/connection.rs, open_bi doc: waiting on the RecvStream without writing to the SendStream never succeeds). So the server's accept_bi never returns, and advance(6s) fires ACCEPT_BI_TIMEOUT (probe.rs, timeout(ACCEPT_BI_TIMEOUT, conn.accept_bi())) instead. The handler returns Err, the connection drops, and the implicit close uses code 0. assert_reset_with_code(&mut recv, 0x00) accepts that ApplicationClosed { error_code: 0 }, so the test passes.
Result: the PROBE_READ_TIMEOUT reset-and-close path has no test. The test still passes if that timeout is deleted. It duplicates probe_accept_bi_timeout_errors_handler.
Fix
Write a partial frame (or one byte) on send before advance, so the server accepts the stream and blocks in read_frame. Then the advance fires PROBE_READ_TIMEOUT.
Assert something only the read-timeout path produces, so the test cannot pass through the accept path: for example the close reason b"probe-error", which the accept-timeout path does not send.
Check that the test fails when the PROBE_READ_TIMEOUT arm is removed.
Related (fragile, not broken)
Both probe timeout tests run a real iroh bind and QUIC handshake under start_paused = true. When a loopback datagram is not readable at an idle poll, auto-advance can jump to iroh/noq timers (PTO, keep-alive, path idle), so a slow host can turn the expected close into a TimedOut. Consider pausing only after the handshake (tokio::time::pause() after spin_up_probe_harness) so only the handler's timeout runs on virtual time.
area:nodedecdn-node daemon: runtime, handlers, admin RPC, serve pathkind:bugSomething does not behave as documentedkind:testTest coverage, flakes, fixtures or the e2e harnessprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Activity