open-standards/joule-code/joule-code-rs/crates/joule-moq-ingest/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science b85bba936f
Some checks failed
joule-code conformance gate / joule-moq-relay, its own energy on a counter (macos) (push) Successful in 48s
joule-code conformance gate / Build + round-trip C1-C4 vectors (push) Successful in 1m50s
joule-moq-remote host agent / joule-moq-remote · does this change touch it (push) Has been cancelled
joule-moq-remote host agent / joule-moq-remote, every target (linux-arm64) (push) Has been cancelled
joule-moq-remote host agent / joule-moq-remote, every target (macos) (push) Has been cancelled
joule-moq-room room service / joule-moq-room · does this change touch it (push) Has been cancelled
joule-moq-room room service / joule-moq-room, every target (push) Has been cancelled
joule-moq-web browser client / joule-moq-web · does this change touch it (push) Has been cancelled
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (push) Has been cancelled
wai-app and Create / wai-app · does this change touch it (push) Has been cancelled
wai-app and Create / wai-app · tests, clippy, the line language's verifier (linux) (push) Has been cancelled
wai-app and Create / wai-app · Create, browser end-to-end (macos) (push) Has been cancelled
wai-fleet service / does this change touch it (push) Has been cancelled
wai-fleet service / service · linux (push) Has been cancelled
wai-fleet service / service · macos (push) Has been cancelled
WAI Studio / does this change touch it (push) Has been cancelled
WAI Studio / the catalogue's actions, the unit tests and the core · linux (push) Has been cancelled
WAI Studio / Studio in Chromium and Firefox · macos (push) Has been cancelled
WAI Studio / Studio in WebKit · linux (push) Has been cancelled
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Has been cancelled
joule-code conformance gate / joule-moq-relay, every target (push) Successful in 4m3s
joule-code conformance gate / joule-moq-ingest, every target (push) Successful in 7m26s
joule-moq-ingest: a refused start, a dial at the stop and a task ended past the bound leave no port bound
GatewayServer::start bound HTTP, spawned the HTTP and SRT accept loops, then bound RTMP and
RTMPS and started the injector. Refused at any of those (a port held, the RTMPS identity, the
injector's port or grant), its `?` dropped the loops' handles, which leaves the tasks running.
The SRT loop waits for a stop that never comes, so the HTTP and SRT ports stayed bound for the
life of the process and every later start failed "Address already in use". It now binds every
port and makes every check before it spawns a task to serve one. The SRT listener, whose own
task runs from its bind, is closed when the injector, last, is refused.

A session whose flow was taken while it was still dialing the relay was in no list the shutdown
ends. A dial lasts up to 10 s (relay::STEP), past the 5 s the shutdown waits for its tasks, so
the session was ended without its record and its RIST listener dropped unclosed. The dial now
ends at the stop signal. The session ends at once and signs its record, `gateway_stopped`, as
one that starts once the shutdown has begun does, with nothing published
(Publisher::detached).

A RIST listener held by a task the shutdown ends past its bound only told its receiver to go,
so the shutdown could return with the RIST port bound. The gateway now keeps a RistCloser of
each RIST listener its tasks hold (Gateway::hold_rist, called as one is bound) and closes them
once its tasks have ended or been ended. contrib::serve_rist serves a RIST session at its
listener this way, and /rist uses it. wt-ingest's issue_rist can call it in place of its copy.

New tests, each from a task on a runtime of one worker, on fixed ports below the range handed
out for port 0 (tests/common: low_tcp, low_udp, low_pair):
- tests/start_ports.rs: every listener on a fixed port. The RTMP, RTMPS, SCTE 104 and SRT ports
  are held in turn, then the RTMPS key is spoiled. Every other port binds at once when the
  refusal returns, and a start with nothing held comes up on all of them. 5 rounds.
- tests/shutdown_ports.rs (rist): a session whose relay never answers its dial is stopped. Its
  RIST ports bind at once and its record reads `gateway_stopped`.
- tests/shutdown_ports.rs (rist): a RIST listener held by a gateway task that never ends. After
  the shutdown ends that task past the 5 s bound, both ports bind at once. Only the listener's
  ports are checked: the gateway's own are let go 5 s earlier.

Fail-first on unfixed origin/main (b56b175e9, Linux; the third test without the new hold_rist
call), all at round 0:
- "round 0, the RTMP port held: TCP 127.0.0.1:22764 is still bound when the refused start
  returns"
- "round 0: UDP 127.0.0.1:22452 is still bound when the shutdown returns", and 22580 for the
  other.

Each part of the fix is held on its own (mutation runs on the fixed tree, Linux):
- The dial not watching the stop: the record test fails, left [] right ["gateway_stopped"], the
  shutdown taking 5.0016 s.
- The shutdown not closing the held listeners: the held-listener test fails on its port.
- The SRT listener dropped, not closed, when the injector is refused: start_ports fails on the
  SRT port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 10:49:49 -05:00
..
common joule-moq-ingest: a refused start, a dial at the stop and a task ended past the bound leave no port bound 2026-11-09 10:49:49 -05:00
auth_and_ice.rs joule-moq-ingest: the HTTP proof step on its own, its corpus vectors, and the tests on proofs 2026-10-18 19:14:04 -04:00
codecs.rs WIP joule-moq-ingest: proof of possession at the gateway (unbuilt; tests incomplete) 2026-10-18 16:23:14 -04:00
conformance_corpus.rs joule-moq-ingest: clippy notes cleared 2026-10-25 23:09:36 -04:00
contrib_bench.rs joule-moq-relay: a stream's flow-control window of 16 MiB, configurable 2026-10-26 02:37:34 -04:00
contrib_interop.rs joule-moq-ingest: interop states the link's account before comparing frames 2026-10-26 03:19:39 -04:00
contrib_rist.rs joule-moq-ingest: SRT and RIST contribution into room tracks, with a signed link record 2026-10-25 22:47:27 -04:00
contrib_srt.rs joule-moq-ingest: the 20 Mbit/s SRT test gives its link a window of two seconds 2026-11-01 20:53:47 -05:00
ertmp.rs Merge #483 (wai/ingest-srt-rist @b54dc94c): SRT and RIST contribution ingest, with a signed link record 2026-10-26 08:41:50 -04:00
ertmp_ffmpeg.rs joule-moq-ingest: clippy notes cleared 2026-10-25 23:09:36 -04:00
link_corpus.rs joule-moq-ingest: SRT and RIST contribution into room tracks, with a signed link record 2026-10-25 22:47:27 -04:00
metrics.rs Through a front the gateway reads a grant at /metrics as at any path it does not have, answers HEAD as GET, and a test asks every resource of its table 2026-11-07 01:50:41 -05:00
room_corpus.rs joule-moq-ingest: the HTTP proof step on its own, its corpus vectors, and the tests on proofs 2026-10-18 19:14:04 -04:00
scte104_injection.rs joule-moq-ingest: clippy notes cleared 2026-10-25 23:09:36 -04:00
shutdown_ports.rs joule-moq-ingest: a refused start, a dial at the stop and a task ended past the bound leave no port bound 2026-11-09 10:49:49 -05:00
start_ports.rs joule-moq-ingest: a refused start, a dial at the stop and a task ended past the bound leave no port bound 2026-11-09 10:49:49 -05:00
whep_play.rs WIP joule-moq-ingest: proof of possession at the gateway (unbuilt; tests incomplete) 2026-10-18 16:23:14 -04:00
whip_publish.rs WIP joule-moq-ingest: proof of possession at the gateway (unbuilt; tests incomplete) 2026-10-18 16:23:14 -04:00