[GH-ISSUE #6183] horizon-friends: the deadline unit test hangs forever on Windows #2006

Closed
opened 2026-11-02 15:51:18 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Ragbie on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6183

Originally assigned to: @Ragbie on GitHub.

🤖 Filed by Ragbie's AI agent (Claude Code, Opus 5.5), not by Ragbie personally.

On Windows, horizon-friends' unit test tests::a_deadline_ends_the_stream_unless_dropped (crates/horizon-friends/src/lib.rs) never finishes, so cargo test --workspace (and pr_ready.py when a change touches horizon-friends or horizon-relay) hangs there until the process is killed. CI's verify runs on Linux only, so it doesn't see it.

  • Upstream main 41501a243, Windows 11, Rust 1.98.1: timeout 20 cargo test -p horizon-friends --lib a_deadline_ends_the_stream_unless_dropped → killed by the timeout (exit code: 143); the process sits at 0% CPU. In a full workspace run it was still blocked after 113 s.
  • Cause: the test blocks in read with no timeout and expects deadline's thread to wake it with shutdown(Both). Linux wakes a blocked reader on shutdown; Windows doesn't (a blocked recv keeps waiting).

Players are not affected: every read made while a Deadline runs also has a read timeout (direct::read_hello 5 s, the relay's first_line), and on Windows a peer that keeps sending one byte at a time is still cut right after the limit (the next byte after the shutdown resets the stream; measured 0.35 s with a 300 ms limit). So this is a test fix: read after the limit instead of before it, plus a test for the one-byte-at-a-time peer the deadline exists for.

Originally created by @Ragbie on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6183 Originally assigned to: @Ragbie on GitHub. > 🤖 Filed by Ragbie's AI agent (Claude Code, Opus 5.5), not by Ragbie personally. On Windows, `horizon-friends`' unit test `tests::a_deadline_ends_the_stream_unless_dropped` (`crates/horizon-friends/src/lib.rs`) never finishes, so `cargo test --workspace` (and `pr_ready.py` when a change touches `horizon-friends` or `horizon-relay`) hangs there until the process is killed. CI's `verify` runs on Linux only, so it doesn't see it. - Upstream `main` `41501a243`, Windows 11, Rust 1.98.1: `timeout 20 cargo test -p horizon-friends --lib a_deadline_ends_the_stream_unless_dropped` → killed by the timeout (`exit code: 143`); the process sits at 0% CPU. In a full workspace run it was still blocked after 113 s. - Cause: the test blocks in `read` with no timeout and expects `deadline`'s thread to wake it with `shutdown(Both)`. Linux wakes a blocked reader on shutdown; Windows doesn't (a blocked `recv` keeps waiting). Players are not affected: every read made while a `Deadline` runs also has a read timeout (`direct::read_hello` 5 s, the relay's `first_line`), and on Windows a peer that keeps sending one byte at a time is still cut right after the limit (the next byte after the shutdown resets the stream; measured 0.35 s with a 300 ms limit). So this is a test fix: read after the limit instead of before it, plus a test for the one-byte-at-a-time peer the deadline exists for.
Author
Owner

@Ragbie commented on GitHub (Nov 1, 2026):

/claim

<!-- gh-comment-id:6561700080 --> @Ragbie commented on GitHub (Nov 1, 2026): /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2006
No description provided.