Skip to content

test(mixer): link a late test input fully before it can start - #1041

Merged
srperens merged 1 commit into
mainfrom
test/mixer-late-input-locked
Oct 7, 2026
Merged

srperens merged 1 commit into
mainfrom
test/mixer-late-input-locked

Conversation

@srperens

@srperens srperens commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Problem

blocks::builtin::mixer::tests::test_late_input_at_another_rate_is_resampled fails now and then on the Linux runner. It hit main and #1029:

pipeline error: … GstAudioTestSrc:audiotestsrc24: streaming stopped, reason not-linked (-1)

A diagnostic branch ran mixer::tests 80 times on ubuntu-24.04 and failed 5 times. On each failure the test dumped every pad in its pipeline:

  • the test's own capsfilter (decoded) had NotLinked as its sink pad's last flow return;
  • convert_0, the mixer input it feeds, had no error;
  • every link was in place by the time of the dump.

So the capsfilter pushed before its src pad had a peer. The test added the source and capsfilter to the running pipeline and linked them, but they could start before the capsfilter's link to the mixer existed. The test also started the source before the capsfilter.

Change

Test only. The late source and capsfilter stay set_locked_state(true) until they are fully linked into the mixer, and are then started downstream first. That is the usual way to add elements to a running pipeline. The test still checks the same thing: a late input at another rate links into a running mixer and is heard on main and on an aux bus.

Evidence

  • On the Linux runner, 80 runs of mixer::tests each:
  • Unverified: exactly what started the elements before they were unlocked. It is inferred from the dumps above, and not traced further.
  • This is a race in the test's own setup, so no test fails if the change is reverted, beyond the flake rate above.

Tests

Ran (macOS, GStreamer 1.28.6): cargo test --lib late_input (passed). Linux: the runner statistics above.

Out of scope

  • Production code that links inputs into a running mixer (for example a WHIP Input slot) is not changed here.

🤖 Generated with Claude Code

test_late_input_at_another_rate_is_resampled added a live audiotestsrc
and a capsfilter to the running pipeline and started the source first.
On the Linux runner the capsfilter sometimes pushed before it had a peer
and the flow failed with not-linked (5 of 80 runs of mixer::tests).
Keep both locked until linked, then start the capsfilter first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@srperens
srperens merged commit c96ccf3 into main Oct 7, 2026
9 checks passed
@srperens
srperens deleted the test/mixer-late-input-locked branch October 8, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant