Skip to content

test(latency): skip the mixer latency tests on the macOS and Windows runners, and say why they fail - #1106

Merged
srperens merged 1 commit into
mainfrom
fix/latency-diagnosis-tests-macos-windows
Oct 27, 2026
Merged

srperens merged 1 commit into
mainfrom
fix/latency-diagnosis-tests-macos-windows

Conversation

@srperens

Copy link
Copy Markdown
Collaborator

Refs #1073

Problem

The two real-pipeline tests from #1073 fail now and then on the macOS and Windows runners, and turn main red there:

Test macOS (GStreamer 1.28.8) Windows
finds_both_inputs_of_a_mixer_that_cannot_configure_latency failed in runs 39574947907, 39603058637 (and passed in 39585112531) failed in 39574947907, passed in 39585112531 and 39600543567
a_mixer_latency_failure_is_reported_once_with_its_inputs passed in all three failed in 39574947907 and 39585112531

When they fail, the message says only the mixer never warned or expected the latency warning once, got [], which does not show why.

Change

  • Both tests skip on the macOS and Windows runners through common::skip_known_ci_failure. Linux CI still runs them, and so does a local run.
  • finds_both_inputs_of_a_mixer_that_cannot_configure_latency moves from the latency_diagnosis unit tests into backend/tests/latency_diagnosis_test.rs. It runs a real GStreamer pipeline, and the skip helper lives in tests/common. The pure describe tests stay in the lib.
  • On failure, both tests now report the pipeline state, the warnings (and, in the unit test, errors) the bus carried, and what each mixer input answers to a latency query at the deadline.

Rejected for now: changing bus.rs or the diagnosis. The cause is not shown yet (below), and the new messages are there to show it.

Evidence

A diag workflow on the macOS runner (temporary diag/ branch, deleted) looped the unit test with a trace of every warning and what each input answered:

  • Run 39607940197: 20 of 20 runs of the test alone, and 8 of 8 runs of the full lib suite, passed. In every run the first warning arrived while the pipeline was still going to PLAYING, and both inputs already answered as expected (slow min 2023 ms, bridge max 1000 ms).
  • Run 39609379295, with CI's environment (STROM_REQUIRE_GST_PLUGINS, STROM_REQUIRE_GL, STROM_SKIP_KNOWN_CI_FAILURES): 5 of 5 alone passed, 11 of 12 full lib-suite runs passed. The failed run logged no warning at all. So in the failure the mixer posts no "Impossible to configure latency" warning in 5 s. It is not the diagnosis returning nothing.

Unverified: why the mixer posts none. A lead: on a loaded runner the latency query at the PLAYING transition may fail outright ("Latency query failed" shows up in these logs), and nothing queries again. If so, an operator can miss the diagnosis too. The new failure messages should show it the next time this fails on Linux or locally.

Tests

  • Ran on macOS (GStreamer 1.28.x, local): cargo test --features efp --test latency_diagnosis_test (2 passed), and the same with STROM_SKIP_KNOWN_CI_FAILURES=1 (both print SKIP: known CI runner failure and return). cargo test --features efp --lib latency_diagnosis (2 passed). cargo clippy --features efp --all-targets -D warnings clean.
  • Not run locally: the full suite.
  • This PR carries ci:macos and ci:windows, so both runners exercise the skips.

For the reviewer

level_3_1_offer_gets_1080p_video_encoded_by_the_block also fails on the Windows runner on main (WHEP endpoint ... never listened, runs 39574947907 and 39585112531). It is not touched here.

Out of scope

Finding why the mixer posts no warning under load, and whether production code should query again.

🤖 Generated with Claude Code

…runners, and say why they fail

Both tests from #1073 fail now and then on the macOS and Windows runners:
the mixer posts no "Impossible to configure latency" warning at all. In a
diag run on the macOS runner the unit test failed 1 of 12 full lib-suite
runs with CI's environment, and 0 of 25 runs on its own.

They now skip there through skip_known_ci_failure and still run on Linux
and locally. The real-pipeline test moves from the lib into
latency_diagnosis_test so it can reach that helper. When either fails, its
message now carries the pipeline state, the warnings the bus carried, and
what each mixer input answers at the deadline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@srperens srperens added ci:macos Run Build (macOS) on this pull request ci:windows Run Build (Windows) on this pull request labels Oct 27, 2026

@srperens srperens left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Area: tests, mixer latency diagnosis

Skips both #1073 mixer-latency tests on the macOS and Windows CI runners and adds failure diagnostics. The diagnostics are useful and the skip is precise. The stated cause is not settled, though, and the skip removes the only coverage on the two platforms where the failure is still unexplained.

Neighbours: no open PR touches this area. #964 matters here: Linux CI runs GStreamer 1.24.2, so after this PR these tests run only on 1.24.2. They no longer run on 1.26 (production) or 1.28 (macOS), which is where they fail.

  1. The skip is a runtime check (backend/tests/common/mod.rs:69-77) and the list does not include linux, so Linux CI still runs both tests. Local runs are not skipped either.
  2. No issue tracks the cause or re-enabling the tests. If the mixer really goes silent under load, an operator on macOS or Windows gets no diagnosis, and Strom ships there. Naming an issue in the skip reason would let the SKIP: line in CI logs point to it.
  3. The 3 s and 5 s windows sit close to the 2 s jitterbuffer (inline).

Not verified: anything on the runners themselves. The upstream aggregator reading below comes from source and was not tested.

//!
//! On a loaded runner the mixer sometimes posts no latency warning at all
//! (no warning reached the bus in 5 s, 1 of 12 full lib-suite runs on the
//! macOS runner). So both tests skip on the macOS and Windows runners, and

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR body's lead cause is that the latency query fails at the PLAYING transition and "nothing queries again". Upstream GstAggregator (1.28 gstaggregator.c) does not seem to work that way. gst_aggregator_get_latency_unlocked re-runs the query while has_peer_latency is FALSE, which is only set on success, and gst_aggregator_wait_and_check calls it on every src-task wake. So the first slow buffer, about 2 s after PLAYING, should trigger a fresh query and a warning. Five silent seconds then points to a query that keeps failing, or to a src task that does not wake. A GST_DEBUG=aggregator:5 trace from the runner would tell these apart. Not verified on the runner's build.

// a few seconds, well inside the gate's interval, one warning gets out.
let mut latency_warnings = Vec::new();
let mut other_warnings = Vec::new();
let _ = tokio::time::timeout(Duration::from_secs(3), async {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test listens for only 3 s, and slow sits behind rtpjitterbuffer latency=2000. If the warning at the PLAYING transition is missed, the next chance comes when slow data reaches the mixer, at least 2 s in. That leaves under 1 s on a loaded Windows runner, where this test failed. A window of about 8 s would still be inside the 10 s gate interval (backend/src/gst/pipeline/warning_gate.rs:12), so len() == 1 would still hold. That may be a fix, not just a skip. Not verified as the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:macos Run Build (macOS) on this pull request ci:windows Run Build (Windows) on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant