open-standards/joule-code/joule-code-rs/crates/joule-moq-relay/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 6675337c84 joule-moq-relay: a start refused part way returns with every port it bound free
RelayServer::start spawned each QUIC endpoint's accept loop, then bound the WebSocket listener,
then started the control surface.
- Refused at the WebSocket bind, its `?` dropped the accept loop's handle. That leaves the task
  running with the endpoint and its UDP socket for the life of the process.
- Refused at the control surface, it told the tasks to go but did not wait for them.

A start that waits out a port another process holds by retrying then failed every retry on the
UDP port its own first try kept. wt-relay's run::start retries 40 times, and wt-api sets
websocket_listen in deployment.

A refused start is now shut down as a relay is (RelayServer::shutdown) before its error
returns: every task it spawned has ended and every port it bound is free. Control::start
refused part way (the control port, a file in the socket's place, SIGHUP) now closes the TCP
listener and tasks it had started; before, its `?` left them running. Control is Default
(serving nothing).

New tests/start_ports.rs, from a task on a runtime of one worker, on fixed ports below the
range handed out for port 0:
- The WebSocket port held, the control port held, a file where the control socket goes. Each
  time, every other port binds at once when the refusal returns, and a start with nothing held
  comes up on all of them. 10 rounds.
- The control surface alone, refused at its socket 20 times; its TCP port binds at once each
  time. This one also catches a Control::start that only drops what it started without
  awaiting it (mutation run on Linux).

Fail-first on unfixed origin/main (b56b175e9, Linux): both failed at round 0:
- "round 0, the WebSocket port held: UDP 127.0.0.1:21768 is still bound when the refused start
  returns: Address already in use (os error 98)"
- "round 0, the control surface refused: TCP 127.0.0.1:21896 is still bound ..."

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 10:49:49 -05:00
..
common joule-moq-relay: sessions at -18 and -16 beside -22 2026-10-21 05:26:55 -04:00
age_rising.rs relay tests: wait on what the relay holds, not on fixed sleeps and windows 2026-10-24 20:59:10 -04:00
age_room_service.rs joule-moq-relay: count each author's audience inputs in its chain's order, not in arrival order 2026-10-25 03:56:05 -04:00
age_serving.rs relay tests: wait on what the relay holds, not on fixed sleeps and windows 2026-10-24 20:59:10 -04:00
auth_tokens.rs joule-moq-relay: a DVR store on disk, FETCH from it, the seek power, and WMH1 version 2 (work in progress) 2026-10-19 11:32:38 -04:00
cascade.rs joule-moq-relay: the loop-of-relays test starts again on new ports when one it chose was taken 2026-11-05 10:24:38 -05:00
connection_window.rs joule-moq-relay: bound a session's unread bytes by a connection window 2026-10-26 03:39:45 -04:00
drafts.rs joule-moq-relay: a -16 Request ID ahead of one in flight on another stream is admitted 2026-10-21 12:45:13 -04:00
dvr.rs joule-moq-relay's DVR tests keep their stores in memory on Linux 2026-11-07 09:03:46 -05:00
fetch_in_flight.rs joule-moq-relay: a mux self-deadlock fixed; a FETCH waits for groups still arriving 2026-10-19 07:32:44 -04:00
floor.rs relay floor test: the payload check is the one an arrival-order relay fails first 2026-10-25 03:56:05 -04:00
goaway.rs joule-moq-relay: GOAWAY on shutdown, tokens by alias, and fan-out order under load 2026-10-17 04:45:24 -04:00
grant_proof.rs joule-moq: drafts chosen by this crate's preference; relay tests and client take the draft 2026-10-21 05:33:13 -04:00
late_joiner.rs joule-moq-relay: the cache covers the run of whole groups, not where its first object fell 2026-10-17 12:12:35 -04:00
live_control.rs A metered record runs in the room it states, and a revocation refuses a grant a request presents 2026-11-07 03:49:46 -05:00
priority_fan_out.rs joule-moq-relay: GOAWAY on shutdown, tokens by alias, and fan-out order under load 2026-10-17 04:45:24 -04:00
publish_done_streams.rs joule-moq, joule-moq-relay, joule-moq-interop: clippy's notes on this branch's code 2026-10-21 12:57:39 -04:00
quic_sockets.rs joule-moq-relay: a fan-out holds up no other track, and each core has its own socket 2026-11-02 19:05:27 -05:00
relay_energy.rs A relay keeps no second copy of its counts until its first flush, seals on an interval when told, and goes by the peer the kernel states 2026-11-07 03:49:45 -05:00
relay_quic.rs joule-moq-relay: two publishers and three subscribers over QUIC, WebTransport and WebSocket 2026-10-17 04:37:09 -04:00
relay_websocket.rs joule-moq-relay: each end of a WebSocket session pings the other every 30 s 2026-10-27 14:36:33 -04:00
relay_webtransport.rs joule-moq-relay: two publishers and three subscribers over QUIC, WebTransport and WebSocket 2026-10-17 04:37:09 -04:00
request_ids.rs joule-moq-relay: Request ID rules and requests bounded by the stream limit 2026-10-17 04:49:29 -04:00
room_authority.rs joule-moq-relay: a DVR store on disk, FETCH from it, the seek power, and WMH1 version 2 (work in progress) 2026-10-19 11:32:38 -04:00
room_metering.rs joule-moq-relay: meter the relay's own energy for real, or sign the unmetered marker 2026-10-26 08:30:49 -04:00
sealed_objects.rs joule-moq-relay: a test of sealed objects through the unchanged relay (WIP) 2026-10-19 20:47:53 -04:00
shutdown_ports.rs joule-moq-relay: a shutdown returns once every session has ended and every port is free 2026-11-07 11:56:51 -05:00
slow_subscriber.rs joule-moq-relay: clippy's notes on the new test code 2026-10-18 07:40:14 -04:00
start_ports.rs joule-moq-relay: a start refused part way returns with every port it bound free 2026-11-09 10:49:49 -05:00
upstream_window.rs joule-moq-relay: an upstream link is held to the listener's receive windows 2026-10-26 08:52:18 -04:00
version.rs wai doctor: whether this machine can run the toolchain, one check to a line 2026-11-06 17:24:16 -05:00
webtransport_close.rs joule-moq-relay test: the client closes after the relay holds its session 2026-10-21 07:39:04 -04:00