You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky Tier 2: test_source_transition_slots clear_empties_both_slots child_alive under load #4680
Local repro on origin/master 8f1deb9: four concurrent ctest --repeat until-fail:250 lanes in a 4-CPU Docker task. Lane 3 failed on repetition 41 with child_alive(1) (line 246). Lane 4 failed on repetition 43 with child_alive(0) (line 245). The same suite passed 100 serial repeats.
It looks like a timing race: the child source is released asynchronously (for example via the destruction task or the video thread) after the transition clears its slots, and the test checks the child before release finishes under load. Fix it in the Rust/C implementation or by deterministic synchronization in libobs. Don't edit the existing C test.
Evidence and launchers: the pool's fix-4672b report (focused.py, stress.py, master-lane3.log, master-lane4.log).
/ready
Coordinator triage. The reproduction is concrete: 4 parallel ctest --repeat until-fail:250 lanes in a 4-CPU Docker task fail at about repeat 41, and a hosted run failed the same way.
Acceptance: the unchanged test passes the same parallel repeat against both hybrid libobs and the C reference. Commit the RED evidence first, then the deterministic fix. Do not edit test_source_transition_slots.c (AGENTS.md: existing C tests stay unchanged).
#4800 may share the same asynchronous release path. Check it in the same investigation.
Could not reproduce on today's master (2026-11-14), so I'm not claiming this.
What I tried, on a 16-thread Ryzen 9 6900HX, with RelWithDebInfo builds of both libobs variants (hybrid Rust and C reference) from today's master. Each lane runs the unchanged test_source_transition_slots binary in a loop with ctest's environment (LP_NUM_THREADS=1, the rundir as working directory), on its own Xvfb display, and stops at the first failure:
libobs
load
runs
failures
C reference
16 parallel lanes × 150
2400
0
hybrid
16 parallel lanes × 150
2400
0
hybrid
8 lanes pinned to 2 CPUs (taskset -c 0-1) × 100
800
0
hybrid
6 lanes × 80 on 2 CPUs, plus 4 busy-loop hogs on the same CPUs
480
0
(A first attempt with xvfb-run -a in parallel "failed" on rep 1 in most lanes; that was xvfb-run lanes racing for display numbers, not the test. Separate Xvfb displays fixed it.)
One candidate for the window, not confirmed: tick_sources() (libobs/obs-video.c.h:47-66) takes a reference on every non-removed source in data->sources, private ones included, ticks them, then releases. If obs_transition_clear() drops the test's last references while the video thread is between that obs_source_get_ref() and its obs_source_release(), the weak reference still gives the source and child_alive() is true. That code is the same in both variants, and the C reference didn't fail here either. So if this is the cause, it's a test-timing race and not a Rust regression, and the fix would be a decision about the test (which AGENTS.md says not to edit) or about upstream tick semantics, not a libobs port fix.
Someone with the original Docker setup (4 lanes in a 4-CPU task) is better placed to reproduce it.
Claiming: investigation and fix for transition-slot lifetime flake on branch fix/4680-transition-slot-lifetime.
Measure recent merge-group hits and repeat the unchanged suite in four parallel lanes sharing four CPUs on current master, against hybrid and C reference.
Trace source references and distinguish an implementation race from test assumptions; add deterministic Rust regression coverage for any implementation fix. Use a CTest resource lock only with demonstrated cross-test interference.
#5054 merged at 08:23Z: this test is now in test/cmocka/known-flaky.txt, so a merge-queue run whose ONLY failures are registered tests retries them once and passes with a ::warning:: (and a step-summary line) instead of ejecting the group. This shields the queue; it does not resolve the root cause, so this issue stays open. Remove the registry line in the PR that fixes it.
Decision needed: may I add one line to test/cmocka/test_source_transition_slots.c to fix this flake? AGENTS.md says existing C tests stay unchanged, so this needs your yes.
I reproduced it on demand against the C reference with two local-only delays (neither would be committed): 30 ms in tick_sources() right after it takes its source references (libobs/obs-video.c.h), and 40 ms in clear_empties_both_slots before obs_transition_clear(), so a tick is sure to pick the children up first:
OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 3 --tests test_source_transition_slots
[OFF] tests load /build/tree/libobs-c-reference/libobs.so.30
[ ERROR ] --- child_alive(0) is not false
[ LINE ] --- /ro/test/cmocka/test_source_transition_slots.c:246: error: Failure!
(That's line 245 without the added delay line, which is the failure in this issue.)
Cause: tick_sources() holds its own reference on every source while it ticks, and the video thread releases it after obs_transition_clear() has already dropped the transition's references, so the weak reference still gives the child for a moment. The C reference does the same thing, and this is how upstream libobs works, not a port bug. Changing the tick to stop holding references would differ from upstream and risk deadlocks, so I don't recommend fixing it in libobs.
Proposed fix: child_alive() calls obs_wait_for_destroy_queue() before it checks the weak reference. Since #5407 that waits for a video tick even when no audio is running (this fixture only resets video), which is the same wait that fixed #4800 in test_transition_load_release. With both delays still in place and that one line added, the test passes against the C reference.
If you say yes, I'll claim this and open one PR: that line plus removing the test's line from known-flaky.txt, with the RED run above and the GREEN run in the body.
Decided: yes, add the obs_wait_for_destroy_queue() call to child_alive() in test/cmocka/test_source_transition_slots.c, and in the same PR remove the test's line from test/cmocka/known-flaky.txt.
Reasons:
The rule (testing-policy.md, "Do not edit a public header or an existing C test to accommodate the Rust implementation"; AGENTS.md, "... to make a port pass") protects tests as an oracle for the port. This edit doesn't accommodate the port: rdoupe reproduced the failure against the C reference, and the cause is upstream tick_sources() holding a tick reference. The test checked a weak reference without waiting for that reference to drop.
Conditions for the PR: change no assertion and remove none; add only the wait. Put the C-reference RED (the two local delays, not committed) and the GREEN in the body, plus rust/tools/linux-validate/run.py --repeat 100 --tests test_source_transition_slots passing in both the OFF and ON builds. Refs #4680 (Fixes once it is green). rdoupe, go ahead and claim it.
Activity
vpacher commentedon Nov 13, 2026
/ready
Coordinator triage. The reproduction is concrete: 4 parallel
ctest --repeat until-fail:250lanes in a 4-CPU Docker task fail at about repeat 41, and a hosted run failed the same way.Acceptance: the unchanged test passes the same parallel repeat against both hybrid libobs and the C reference. Commit the RED evidence first, then the deterministic fix. Do not edit
test_source_transition_slots.c(AGENTS.md: existing C tests stay unchanged).#4800 may share the same asynchronous release path. Check it in the same investigation.
rdoupe commentedon Nov 14, 2026
Could not reproduce on today's master (2026-11-14), so I'm not claiming this.
What I tried, on a 16-thread Ryzen 9 6900HX, with RelWithDebInfo builds of both libobs variants (hybrid Rust and C reference) from today's master. Each lane runs the unchanged
test_source_transition_slotsbinary in a loop with ctest's environment (LP_NUM_THREADS=1, the rundir as working directory), on its own Xvfb display, and stops at the first failure:taskset -c 0-1) × 100(A first attempt with
xvfb-run -ain parallel "failed" on rep 1 in most lanes; that wasxvfb-runlanes racing for display numbers, not the test. Separate Xvfb displays fixed it.)One candidate for the window, not confirmed:
tick_sources()(libobs/obs-video.c.h:47-66) takes a reference on every non-removed source indata->sources, private ones included, ticks them, then releases. Ifobs_transition_clear()drops the test's last references while the video thread is between thatobs_source_get_ref()and itsobs_source_release(), the weak reference still gives the source andchild_alive()is true. That code is the same in both variants, and the C reference didn't fail here either. So if this is the cause, it's a test-timing race and not a Rust regression, and the fix would be a decision about the test (which AGENTS.md says not to edit) or about upstream tick semantics, not a libobs port fix.Someone with the original Docker setup (4 lanes in a 4-CPU task) is better placed to reproduce it.
zackees commentedon Nov 18, 2026
Claiming: investigation and fix for transition-slot lifetime flake on branch
fix/4680-transition-slot-lifetime.ci: register reproduced transition lifetime flakes
zackees commentedon Nov 18, 2026
#5054 merged at 08:23Z: this test is now in test/cmocka/known-flaky.txt, so a merge-queue run whose ONLY failures are registered tests retries them once and passes with a ::warning:: (and a step-summary line) instead of ejecting the group. This shields the queue; it does not resolve the root cause, so this issue stays open. Remove the registry line in the PR that fixes it.
rdoupe commentedon Nov 21, 2026
Decision needed: may I add one line to
test/cmocka/test_source_transition_slots.cto fix this flake? AGENTS.md says existing C tests stay unchanged, so this needs your yes.I reproduced it on demand against the C reference with two local-only delays (neither would be committed): 30 ms in
tick_sources()right after it takes its source references (libobs/obs-video.c.h), and 40 ms inclear_empties_both_slotsbeforeobs_transition_clear(), so a tick is sure to pick the children up first:(That's line 245 without the added delay line, which is the failure in this issue.)
Cause:
tick_sources()holds its own reference on every source while it ticks, and the video thread releases it afterobs_transition_clear()has already dropped the transition's references, so the weak reference still gives the child for a moment. The C reference does the same thing, and this is how upstream libobs works, not a port bug. Changing the tick to stop holding references would differ from upstream and risk deadlocks, so I don't recommend fixing it in libobs.Proposed fix:
child_alive()callsobs_wait_for_destroy_queue()before it checks the weak reference. Since #5407 that waits for a video tick even when no audio is running (this fixture only resets video), which is the same wait that fixed #4800 intest_transition_load_release. With both delays still in place and that one line added, the test passes against the C reference.If you say yes, I'll claim this and open one PR: that line plus removing the test's line from
known-flaky.txt, with the RED run above and the GREEN run in the body.ci: retry registered known-flaky Tier 2 tests once instead of ejectin…
zackees commentedon Nov 21, 2026
Decided: yes, add the
obs_wait_for_destroy_queue()call tochild_alive()intest/cmocka/test_source_transition_slots.c, and in the same PR remove the test's line fromtest/cmocka/known-flaky.txt.Reasons:
tick_sources()holding a tick reference. The test checked a weak reference without waiting for that reference to drop.test_transition_load_release(bug: libobs: transition load ownership checks fail on parallel master Tier 2 #4800).Conditions for the PR: change no assertion and remove none; add only the wait. Put the C-reference RED (the two local delays, not committed) and the GREEN in the body, plus
rust/tools/linux-validate/run.py --repeat 100 --tests test_source_transition_slotspassing in both the OFF and ON builds. Refs #4680 (Fixes once it is green). rdoupe, go ahead and claim it.rdoupe commentedon Nov 21, 2026
Claiming: the approved one-line wait in
child_alive()plus dropping the test fromknown-flaky.txt, on branchfix/4680-transition-slot-wait.test: wait for the tick before reading a transition child's weak ref (F…