Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nondeterminism of "Update the Rendering" test #48153

Open
gterzian opened this issue Sep 13, 2024 · 3 comments
Open

Fix nondeterminism of "Update the Rendering" test #48153

gterzian opened this issue Sep 13, 2024 · 3 comments

Comments

@gterzian
Copy link
Contributor

gterzian commented Sep 13, 2024

The test added at #15510 is currently still failing for all major browsers for what seems to be various reasons related to the ordering of raf delivery. But, even if the ordering were to be fixed, the test would still remain nondeterministic due to its recursive requesting of rafs: the assertion is made from within a timer callback, and it is possible for multiples "update the rendering" instance to be run before the timer callback is.

This is an example of such failure:

expected array ["parent_raf", "first_child_raf", "second_child_raf"] length 3, got ["parent_raf", "first_child_raf", "second_child_raf", "parent_raf", "first_child_raf", "second_child_raf"] length 6

As you can see, the ordering of raf delivery is correct, but test assertain fails because two instances of the "update the rendering" task were run prior to the timer task. This was noted at servo/servo#33028


As a solution, which would acknowledge that the spec does not mandate any particular relative prioritization between timers and updating of the rendering, I propose we update the test and split the array into chunks of three, and make ordering assertions for each chunk.

@gterzian
Copy link
Contributor Author

cc @dbaron

@dbaron
Copy link
Member

dbaron commented Sep 13, 2024

I haven't fully loaded this back into my head, but after a few minutes of thought I think your proposed update sounds reasonable.

@gterzian
Copy link
Contributor Author

@dbaron Thanks for having looked into it. Could you please review the changes over at servo/servo#33480? (One reason for a PR there is that we can actually check it passes in CI, since the basic ordering constraint are fulfilled already).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants