Repository navigation
test: settle the align-divisor phase before stop, so the Fast Gate stops flaking (#2957) - #2958
Conversation
`align_divisor_restarts_the_phase` pushed 2000, 3000 and 4000 back to back and waited only for the 3000 delivery, so `video_output_stop` could set the stop flag while 4000 was still queued. The video thread then breaks before it takes that frame and `video_output_get_total_frames` reads 3: 18 of 60 runs failed on master 61c814e, reddening the Fast Gate of unrelated PRs. `Session::settle` waits, with a 2 s bound, for the video thread to finish the frames pushed so far, before the stop. C's `video_output_stop` also drops a frame still queued at shutdown, so the test, not the port, was racing. Fixes #2957
zackees
left a comment
There was a problem hiding this comment.
Reviewed as coordinator (no approval possible on the maintainer's own PR; verdict below).
Verdict: correct, merge when checks finish.
- The diagnosis matches the code: the test pushes 1000/2000/3000/4000 and only waits for the 3000 delivery, so
video_output_stopcan set the stop flag while 4000 is still in the cache slot, and the video thread breaks before it takes it, leavingvideo_output_get_total_framesat 3. C'svideo_output_stopdrops a still-queued frame the same way, so the port is right and the assertion was racing the stop — the fix belongs in the test, as done here. settle(total)polls the real counter withyield_nowand a 2 s bound, and panics with the observed count. That preserves the RED property: if the implementation ever genuinely drops the fourth frame (rather than the test calling stop too early),settle(4)fails naming the count instead of silently passing.- Bound is ample: the harness runs at 30 fps (
rgba_info), so four frames are ~133 ms against 2 s;wait_hits(2)has already ordered the deliveries beforesettleruns. - The assertion set is unchanged (
hits.n == 2, timestamps,total_frames == 4), so no coverage was loosened, and no libobs behaviour, C test or public header is touched — Tier 1 only, nodocs/features.mdline needed. Import ofDuration/Instantis minimal and in the file's existing style.
Nit, not blocking: settle is a busy-poll where the rest of the harness is condvar-driven, because the frame counter isn't behind that mutex. Fine as is; if another test needs it later, a small Condvar-signalled counter would keep the "no sleeps, no spinning" property uniform.
Queuing once the Fast Gate job completes; the merge gate is PR CI plus the queue.
|
Handed off to the coordinator — #2958 is in the merge queue (position 1, AWAITING_CHECKS) with Local evidence on the head: |
align_divisor_restarts_the_phase(from #2926) racesvideo_output_stop, so master's Fast Gate fails at random and takes unrelated PRs with it — my #2951 failed on it while touching only macOS frontend files (run 40936499568, job 123669886573,left: 3, right: 4atrust/obs-media-io/tests/video/video_io.rs:600).RED (master
61c814e48, before this PR)The test pushes 2000, 3000 and 4000 back to back and waits only for the 3000 delivery, so
video_output_stopcan set the stop flag while 4000 is still in the cache slot; the video thread breaks at itsif shared.stopcheck before it takes that frame, andvideo_output_get_total_framesreads 3 instead of 4.40 runs of the whole
tests::video::video_iomodule produced this test and no other failure, so the rest of the module is not racy.C's
video_output_stophas the same property: a frame still queued when the stop flag is set is dropped. The port is right and the test was over-asserting, so the fix belongs in the test.GREEN
Session::settle(total)waits (2 s bound,yield_now, no sleeps — it is the same condvar/no sleepsharness the file already uses) for the video thread to finish the frames pushed so far;align_divisor_restarts_the_phasecallssettle(4)after its lastwait_hits(2)and before the stop. The assertion ontotal == 4is unchanged, and a frame that never gets processed still fails: the settle panics naming the observed count../lintpasses (177 s, lane lint: ok).No user-visible change, so no
docs/features.mdline. Tier 1 only: the change is test synchronization in the Rust test harness, no libobs behavior, C test or public header is touched.Fixes #2957