Repository navigation
Conversation
|
Noted as a draft, so I am holding off on a full review until it is marked ready for review. If you want one before then, say so here or request me as a reviewer. |
3018076 to
d620782
Compare
7732648 to
3fde4aa
Compare
Adds common::block (a block built through its real builder, installed into a bare pipeline with its internal links and element setups), common::bus (first error, first error until a condition holds, and all errors within a window) and common::free_udp_port, and uses them in place of the per-file copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3fde4aa to
dd958b0
Compare
srperens
left a comment
There was a problem hiding this comment.
Verdict: Comment. The refactor checks out and the touched binaries passed in CI. One check is red, in a test this diff does not touch. Re-run it before merging: gh run rerun 37962999488 --failed. If it comes back green, I see nothing that blocks this.
Claims
| Claim | Verdict | Evidence |
|---|---|---|
install links the declared internal links through link_pads, request pads included |
CONFIRMED |
backend/tests/common/block.rs:51 — src.link_pads(from.pad_name.as_deref(), sink, to.pad_name.as_deref()) |
| The recorder helper now shares the same setup runner | CONFIRMED |
backend/tests/common/recorder.rs:66 — crate::common::block::run_setups(&self.ctx);. Every file that includes common/recorder.rs through #[path] (recorder_test, recorder_stall_test, live_recorder_test) also declares pub mod common;, so crate::common::block resolves in all three |
| The touched binaries ran and passed in CI | CONFIRMED |
Check (Linux) job 113930309722: mpegtssrt_input_program_change_test 2 passed, mpegtssrt_streamheader_test 1, output_refusal_test 4, recorder_test 9, rtmp_output_test 16, videoenc_profile_negotiation_test 7. whip_idle_slot_test and whip_slot_caps_reuse_test never ran because cargo stopped at the failure |
| The red check is not this diff's | CONFIRMED |
It is gpu_videotestsrc_direct in vision_mixer_input_format_test, which failed to reach PLAYING. The diff touches no vision mixer file. Check (Linux) passed on main's last five runs, and the same binary has failed on other PRs (#898) |
Diagnosis. This moves duplicated code into one place and changes no behaviour, apart from three differences the body names:
link_padsreplaces the copies that used static pads only;- setup hooks get one flow ID per pipeline;
install_exceptcovers the test that leaves its sink out on purpose.
The body's mutation results do the guard work a refactor can carry. first_error and first_error_until are unguarded, and the body says so honestly: their only caller asserts that there was no error. install is still a copy, not the production linker. Production feeds internal links through Link strings (backend/src/gst/block_expansion.rs:142 — for (from_ref, to_ref) in build_result.internal_links {), so these tests do not cover how the manager resolves pads. That gap predates this PR, which now keeps it in one place instead of fourteen.
Overlaps.
- #935 conflicts with this PR in
backend/tests/common/mod.rs. I checked withgit merge-tree: it is thepub modlines, as the body says. Whichever merges second needs a one-line resolution. #935 already has my Approve, so landing #935 first and rebasing this one is the cheaper order. - #1067 also edits
common/mod.rsand merges cleanly with this PR.
Radius. LOCAL: test code only. Nothing under backend/src changes.
Tests & CI. At dd958b0: both Linux builds, WASM, API Contract and Static JS pass. Check (Linux) fails as above. macOS and Windows were skipped. The code is portable test code, so the main-branch build covering them is acceptable. The branch merges cleanly with current main.
Confidence: HIGH
Opened by Claude (AI), on Peter Wagenet's account.
Refs #912
Problem
Fourteen tests install one block into a bare pipeline by hand, and about twelve read the bus until a deadline, each in its own way. Every copy has to be fixed separately when the block contract changes.
Change
Moves the copies in seven test files and
common/recorder.rsintobackend/tests/common:common::block:context(),install(pipeline, built)(adds the elements, linksinternal_links),install_exceptfor the test that leaves the sink out on purpose, andrun_setups(ctx), which runs the element setup hooks with one flow ID, as the manager does.common::bus:first_error,first_error_until(main's early exit in the SRT program-change test) andcollect_errors.common::free_udp_port(), replacing three identicalsrt_portcopies.One commit on main, independent of #935. The only overlap is the
pub modlines incommon/mod.rs; whichever merges second needs a trivial resolution there.Differences from the copies it replaces:
installlinks withlink_pads, which finds a static or already-requested pad by name and requests one otherwise. Some copies accepted static pads only. For every builder these tests use, the linked pad pairs match the replaced copy's.installis still a copy of the manager's linker, now one copy instead of fourteen. Calling the production linker means exporting it frombackend/src, a separate PR.Evidence
Mutations in the test code, run on this head:
installwithout its link loop failsmpegtssrt_input_program_change_test,mpegtssrt_streamheader_test,videoenc_profile_negotiation_test,whip_idle_slot_testandwhip_slot_caps_reuse_test. The other three binaries need no links.run_setupsas a no-op fails two tests inoutput_refusal_testand two inrecorder_test.collect_errorsdropping every error fails the three tests inoutput_refusal_test.first_errorandfirst_error_untildropping every error fails nothing: their one user asserts there is no error. The copy they replace had the same gap.Tests
Ran (macOS, 2026-10-09): the seven touched test files and
recorder_test: 44 passed, 0 skipped.cargo fmt --checkandcargo clippy --all-targets -- -D warningsare clean. Not run: Windows, the full suite.CI: the Linux check failed in
vision_mixer_input_format_test::gpu_videotestsrc_direct, a graphics test this PR does not touch; that binary failed in other PRs' runs today. Cargo stopped there, sowhip_idle_slot_testandwhip_slot_caps_reuse_testdid not run in that job (both ran and passed in #935's). The other touched binaries ran and passed. A re-run is pending.Out of scope
Eight test files still link blocks by hand:
drop_on_latency_test,liveaudiorouter_test,efpsrt_data_roundtrip_test,live_recorder_test,whip_video_damage_test,whip_slot_flush_test,whep_fanout_bench,whip_slot_decoder_reuse_test. The first and third also keep their own free-port code.shader_validation_testandvision_mixer_fx_testare left alone too; #917 has merged, so they can move in a follow-up.🤖 Generated with Claude Code