Repository navigation
test: wait for fresh ticks in the other profiler tests (GREEN, Fixes #6047) - #6050
Merged
Merged
Conversation
…6047) wait_frames() in test_source_profiler, _gpu, _late and _totals waits on tick_event, an auto event that every tick signals. A tick that nobody waited for leaves it set, and the next wait_frames(n) then waits for one tick fewer (#6043). Clear the event before the loop, as #6044 does in test_source_profiler_run. Defensive: the current calls do not get a stale tick. A probe that times the first wait of each call measured about one frame in all 15 calls, on hybrid libobs and the C reference. docs/knowledge/timing-tests.md gets the lesson (#6043, #6047). Test-only: no libobs change, no assertion changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
vpacher
enabled auto-merge
December 1, 2026 08:11
zackees
reviewed
Dec 1, 2026
zackees
left a comment
Member
There was a problem hiding this comment.
Coordinator review: LGTM. It applies #6044's os_event_reset(tick_event) before waiting to vpacher's four other profiler tests, which have the same leftover-signal race (#6047). Each adds 5 lines of synchronization with no assertion changed, and the lesson goes into docs/knowledge/timing-tests.md. The Tier 2 Linux build failure was a CI token expiry (HTTP Error 618: jwt:expired), which I've rerun. Auto-merge on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6047.
Cause.
wait_frames()intest_source_profiler,_gpu,_lateand_totalswaits ontick_event, an auto event that every tick signals. A tick that nobody waited for leaves it set, and the nextwait_frames(n)then waits for one tick fewer. #6043 hit this intest_source_profiler_run(fixed there by #6044).Change. Each of the four helpers calls
os_event_reset(tick_event)before its loop, as #6044 does.docs/knowledge/timing-tests.mdgets a section on frame waits on an auto event, with how to see a stale wait. Test-only: no libobs change, no assertion changes.Defensive. The current calls do not get a stale tick: these tests remove their sources between cases and call
wait_frames()right after the previous wait. The change keeps a later case from getting the race of #6043.Evidence (Linux, a throwaway probe that times the first wait of each
wait_frames()call; under 1 ms would be a stale tick, about one frame interval is a fresh one):Counting ticks or rendered frames inside the wait did not show the stale case: the stale tick's frame is still being drawn when the wait returns, so it counts as new. The knowledge note says so.
Test cost: no new tests; each
wait_frames()call can take up to one frame more.🤖 Generated with Claude Code