Skip to content

perf(test): wait for the stinger transition to stop instead of sleeping past the clip (#2072) - #3117

Merged
zackees merged 1 commit into
masterfrom
perf/2072-stinger-condition-wait
Oct 31, 2026
Merged

zackees merged 1 commit into
masterfrom
perf/2072-stinger-condition-wait

Conversation

@zackees

@zackees zackees commented Oct 31, 2026

Copy link
Copy Markdown
Member

Refs #2072 (item 4: shorten the real-time Tier 2 tests).

What

test_stinger_media_duration slept a fixed CLIP_MS + 2000 ms (3.6 s) after starting the transition, in each of its five cases: 18 s of the test's 23.5 s. The transition already reports its own state, so wait for it instead:

  • wait_transition_stopped() polls obs_transition_is_active() every 5 ms until the transition stops ticking (the clip has played to its end), with the old CLIP_MS + 2000 as the timeout, so a stuck transition still fails rather than hanging.
  • wait_shows_scene_b() then waits (up to 1 s) for the program output's last recorded frame to be scene B, which the case's final assertion needs. That replaces the "a while after it has ended" part of the sleep instead of assuming the tail frames arrived.

No assertion changed; the same frames must be seen, and the failure messages for a transition that never stops or never shows scene B are new and explicit.

Measured (this checkout's warm Tier 2 volume, xvfb-run, LP_NUM_THREADS=1)

mode before after (6 runs)
libobs-c-reference 23.52 s, 23.53 s 15.00, 14.84, 14.82 s
libobs 23.39 s, 23.40 s 14.81, 14.85, 14.84 s

About -8.6 s (-37%) per mode, i.e. ~17 s off the tests ON/tests OFF lanes together. Six consecutive runs passed in each mode; the seven remaining fixed sleeps are the 700/1500 ms clip-open wait in this test (no public "clip open" signal) and the waits in test_vlc_audio_pacing, test_vlc_playlist_gap, test_pipewire_screencast_resume, test_portal_shortcuts and test_inhibit_sleep_dbus, which are already condition waits or assert that something does not happen inside a real-time window (a 1 s wait for "no next item started" cannot be shortened without weakening it).

Tiers

Tier 1/2 only: this is the unchanged C characterization test; the Tier 2 lanes build and run it. No user-visible change, so no docs/features.md line.

Local gate stamp: none — the change is one cmocka test, and the Tier 2 lanes carry it.

…ng past the clip

`test_stinger_media_duration` ran five cases, each sleeping
`CLIP_MS + 2000` (3.6 s) after starting the transition, for 18 s of fixed
sleep in a 23.5 s test. The transition already reports when it stops
(`obs_transition_is_active()`), and the case's last assertion needs a scene B
frame, which the program output shows. Wait for the transition to stop and
then for that scene B frame, with the old sleep as the timeout, so no
assertion loosens and a genuinely stuck transition still fails.

Refs #2072.
@zackees
zackees enabled auto-merge October 31, 2026 00:54
@zackees

zackees commented Oct 31, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator.

#3117 is ready with auto-merge on: test_stinger_media_duration now waits for obs_transition_is_active() to go false and for the scene B frame, with the old CLIP_MS + 2000 sleep as the timeout. Measured in this checkout's warm Tier 2 volume: 23.5 s -> 14.8-15.0 s in both libobs-c-reference and libobs, 6 runs per mode, all passing. The other six tests in this item are already condition waits or assert a negative inside a real-time window, so they stay as they are.

@zackees
zackees added this pull request to the merge queue Oct 31, 2026
Merged via the queue into master with commit 1e37238 Oct 31, 2026
41 checks passed
@zackees
zackees deleted the perf/2072-stinger-condition-wait branch October 31, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant