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

[code-infra] Fix flaky dashboard screenshot #43890

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Sep 26, 2024

Been debugging the flakyness of the dashboard screenshot. After throttling the playwright browser, it becomes apparent there is a horizontal layout shift while running the test:

Screen.Recording.2024-09-26.at.10.24.13.mov

This shift doesn't happen when just visiting the page. Debugging further reveals that it is caused by the page.screenshot call. Apparently, playwright hides scrollbars when taking the screenshot. It looks like there's a race condition between the responsive charts reacting to a width change and playwright capturing the page. This causes a flaky screenshot.

It looks like we can remedy this by always hiding scrollbars, through the --hide-scrollbars flag.
This causes every scrollbar to disappear

It looks like we can remedy this by always hiding the scrollbar on the body.

Screen.Recording.2024-09-26.at.10.28.25.mov

@Janpot Janpot added test scope: code-infra Specific to the core-infra product labels Sep 26, 2024
@mui-bot
Copy link

mui-bot commented Sep 26, 2024

Netlify deploy preview

https://deploy-preview-43890--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 44f1290

@Janpot Janpot marked this pull request as ready for review September 26, 2024 09:41
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Looks good 👌

@Janpot Janpot merged commit 989e0c0 into mui:master Sep 26, 2024
19 checks passed
@Janpot Janpot deleted the hide-scrollbars branch September 26, 2024 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants