Repository navigation
Fix a flake in ShellTest.SecondaryVsyncCallbackShouldBeCalledAfterVsyncCallback - #190490
Merged
Merged
Conversation
…ncCallback That test calls the engine's ScheduleSecondaryVsyncCallback and ScheduleFrame APIs. If a vsync occurs between the two calls, then the secondary callback will be executed at that vsync, but the frame will be scheduled at the next vsync. That will cause a false negative in the test. This PR changes the test to execute the API calls shortly after a vsync happens. That should ensure that both calls happen during the same vsync interval. This also fixes an issue where VsyncWaiter::FireCallback was not properly resetting the VsyncWaiter's callback. The failure to reset the callback meant that a second call to AsyncWaitForVsync with a different callback would not actually take effect. Fixes flutter#190430
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the SecondaryVsyncCallbackShouldBeCalledAfterVsyncCallback unit test to execute the test task within a vsync interval, and replaces a move operation with a swap in vsync_waiter.cc. Feedback highlights that using ASSERT_TRUE inside a task running on the UI thread can cause the test to hang indefinitely if it fails, and suggests replacing it with EXPECT_TRUE while safely counting down the latch on failure.
This was referenced Aug 5, 2026
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.

That test calls the engine's ScheduleSecondaryVsyncCallback and ScheduleFrame APIs. If a vsync occurs between the two calls, then the secondary callback will be executed at that vsync, but the frame will be scheduled at the next vsync. That will cause a false negative in the test.
This PR changes the test to execute the API calls shortly after a vsync happens. That should ensure that both calls happen during the same vsync interval.
This also fixes an issue where VsyncWaiter::FireCallback was not properly resetting the VsyncWaiter's callback. The failure to reset the callback meant that a second call to AsyncWaitForVsync with a different callback would not actually take effect.
Fixes #190430