-
Notifications
You must be signed in to change notification settings - Fork 4.6k
E2E Tests: Auto-retry canvas block assertions #73153
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
Conversation
|
I'm not super convinced this actually reduces flakey tests. Are there examples where restoring checking immediately would cause a flaky test? Generally when changes are made to the editor, it should be immediately reflected in the resulting blocks. If not, we might have a bug. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
I think it might actually do some damage: if there's failing tests, all these tests together will now take a lot longer to complete because each of the failing tests will be waiting a (few?) seconds until returning the failure |
|
Size Change: 0 B Total Size: 2.57 MB ℹ️ View Unchanged
|
In this case it's more like a safeguard/best practice changes.
True, but that's not always the case for the machinces.
Let's see how this affects current runs. We've been using |
I know, it has been affecting runs I think. When there's a lot of failures, tests take way longer to complete because of the polling. It's not just polling for
I'm just curious when this would happen. Usually, even before Playwright, when there's a flaky test, it's because of our code (time out, animation request...), not because of the machine doing something weird. So I'm highly skeptical that polling for blocks makes any difference with flaky tests. It would be great to see a past example where this happened for |
I think the problem here is the increased number of flaky tests, not Playwright's auto-retries. Unfortunately, the flaky test reports are often ignored these days, and as you mentioned, they might be hiding the reason for issues with our codebase.
I can't remember anything at the moment, will share if I recall one. P.S. We do something similar when rendering values for users in React. We rely on |
e935a22 to
74b1932
Compare
|
Going to close this. We can change assertions as needed. |
What?
Related #73143.
PR replaces
expect( await editor.getBlocks() )Playwright assertions withawait expect.poll( editor.getBlocks ), this should reduce risk of flaky tests.P.S. Hopefully, code editos will also provide better auto-completes, that match our best practices.
See: https://playwright.dev/docs/test-assertions#non-retrying-assertions.
Testing Instructions
All CIs should be green.