Skip to content

test(node): probe_read_timeout_resets_stream_with_zero_code exercises the accept_bi timeout, not PROBE_READ_TIMEOUT #2320

Closed

Description

@yigitdot

Problem

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.

Activity

  1. added
    kind:bug
    rust
    kind:test
    area:node
    on Oct 5, 2026
  2. self-assigned this
    on Oct 6, 2026
  3. self-assigned this
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:nodekind:bugkind:testprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions