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 flaky Overlay tests (hopefully) #1943

Merged
merged 1 commit into from
Dec 20, 2017
Merged

Conversation

cmslewis
Copy link
Contributor

Use nested setTimeouts instead of an arbitrary short delay for one setTimeout. Goal is to delay the code execution until the end of the next frame, not just to the end of the current frame (which may in some instances cause code to invoke before focus has changed / requestAnimationFrame has executed).

@cmslewis
Copy link
Contributor Author

cmslewis commented Dec 19, 2017

...Initial build failed due to yet another (unrelated) flaky test. The irony. Retriggering.

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is ugly but I guess it's not much worse than the current code.

can we try another idea? monkey-patch window.requestAnimationFrame (or global or root or whatever) in the test environment to invoke a specified callback which we can listen for so that we know exactly when it's called. also google around for how other people test this kind of behavior?

@cmslewis
Copy link
Contributor Author

cmslewis commented Dec 20, 2017

@adidahiya we can try that in a follow-up, yes.

@cmslewis cmslewis merged commit a133dff into master Dec 20, 2017
@cmslewis cmslewis deleted the cl/fix-flaky-overlay-tests branch December 20, 2017 19:29
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants