page.waitForFunction: fix call arguments#77300
Conversation
Mamaduka
left a comment
There was a problem hiding this comment.
Good catch. I'm guessing the initial pattern was leftover from Puppeteer, and then it spread.
|
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. |
|
Size Change: 0 B Total Size: 7.74 MB ℹ️ View Unchanged
|
|
Flaky tests detected in a60de15. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24390742287
|
If it wasn't being applied and it wasn't a problem, does that suggest we don't need to be customizing the timeout in the first place? |
|
It's best practice to avoid custom timeouts, unless it's really needed due to some other issues - test being flaky, some unresolved race conditions, etc. IMO, it would be hard to say that this wasn't a problem, and there were no more flaky test reports without these options. |
Maybe it just reduces frequency of flaky test failures. Our CI restarts such tests, so in the end such tests end up green anyway. Just with fewer or more retries. I also suspect that this patch reduced permanent failures in the React 19 upgrade in #61521. The PR used to be perfectly green, but then one day, after a rebase or after an underlying WP update, started failing often on RTC e2e tests. I don't really understand what is going on, at this moment. |
Fixes calls to
page.waitForFunctionin e2e tests. When we want to specify a timeout, it must be the third argument. The second argument areargsto be passed to the function.In our case, the
timeoutwasn't really applied, the value was instead sent to the callback as argument.This is a spinoff from the React 19 upgrade in #61521 where it helped fix some e2e failures.