-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[BUG] page.goto: Timeout XXXms exceeded. No load or domcontentloaded event fired #12182
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
Comments
I can repro, and only in Firefox. |
Ok, but how to solve it? |
same problem |
i'm also having the same problem (firefox) |
I'm also getting this on Webkit + Firefox. Here's a run that exhibited this problem: https://github.com/shopcanal/e2e-tests/runs/5682749027?check_suite_focus=true
|
I have the same problem with Chromium on Ubuntu. So it's not just a Firefox only issue. Every time i run my tests one or two of them might fail randomly with the same waiting until load error:
The corresponding code is nothing fancy. Here are some examples: await Promise.all([
page.waitForNavigation({ url: 'login' }),
page.goto('login')
]); await page.goto('search');
await expect(page.locator('h1')).toContainText('Search');
await page.goto('product/123456');
await expect(page.locator('h1')).toContainText('Product Title'); |
Fixed in #13340 |
Hello, is this problem solved now? Can I download the latest package to solve this problem, or modify my case according to the method of Liuxing Baoyu |
@tillschander we are also facing this issue on our Jenkins pipeline jobs, and again this is totally random any test gets error at any time, out of 50 test cases 2-3 fails due to this (2 workers), and if I increase the number of workers gradually then this count keeps increasing. (in all browsers). But if we run tests in local everything works fine. |
Hello , we are also facing the same issue with timeouts happening randomly. We are running close to 60k tests across multiple machines in 20 minutes. This problem happens when tests run in a pipeline and not when they are running in local. OS: windows any help in this regard will be very useful @zhanglei4333 @liuxingbaoyu @tillschander . |
We are getting the same behavior of random failures. We have ~1500 tests that run on a single worker. We are running under Jenkins using the Docker image. What we see is one or two tests on almost every test run fail with a message similar to:
It is at the point where the test navigates to a page and does waitForNavigation.
I don't have a repro because of the random nature of the failures and it doesn't happen on the same page each time. |
Hello, I am also getting a similar issue with https://app.vwo.com on Chromium, Firefox and Webkit. Post the login, the URL is not getting redirected to the Dashboard and in the network panel, there is no call after the post Login call which gives 200. Steps:
Environment:
On Chromium, Firefox, and Safari the issue is intermediate, while on the local selenium 4 grid it's consistent. |
I turned on DEBUG=pw:api and the failure happens much less often but it did happen a couple of times. Both times while clicking a button to navigate to a new page (using Promise.all with page.waitForNavigation) a silent refresh of the access token occurred . Could this have something to do with the failure? The attached file has the log output from the test that failed. Near the bottom is a comment "FAILURE STARTS HERE". The page.waitForNavigation doesn't complete. In another run where this test succeeds, without the token refresh in the middle, there is an extra log line mentioned in the file that says the page.waitForNavigation succeeded. |
I changed by tests to use DEBUG=pw:channel* and caught a test that succeeded once and failed once. In that test there is a page already loaded with a list page when the test starts. During the test:
In the failure case while the breadcrumb text is being verified the refresh token timer fires and the token renewal process starts (same as the previous test I posted about). This seems to cause problems in the last step of navigating back to the list page. These two files are a successful run of the test and the failed run of the test. I commented the progress of the text. Edit: This is on playwright 1.22.2 running headless under Docker with Jenkins and running under Chromuium. |
We were experiencing the same problem, only in our CI pipelines (tests working locally, failing randomly in pipelines). The following in our playwright config has seemed to fix the problem for us:
Based on the comments above and our experience, my thought is that the vm that's running our tests in ci pipeline just gets a bit overwhelmed in terms of resources. Tons of workers spawning new tests, all running at once, and one just hangs up a bit because ram and cpu are scarce. An additional source of this problem could be the fact locally, we're running tests on localhost; in our pipeline, we're running tests on a real staging website. Websites are fickle, and pages can sometimes load slowly. Increasing the actionTimeout may help with that. If you're still getting failures, you could consider allowing retries. In an ideal world, tests that should pass would pass 100% of the time. In the real world, even if you're running your webapp within a container in your ci pipeline and testing against that (rather than running your tests against a real website), sometimes a page just doesn't load correctly.
|
Just to chime in a little bit on adding some insights, why your tests might fail on CI and seem to be flaky (or blaming Playwright for that matter) - for us, we are using pure ESM modules and if all of your dependencies are native ESM and are optimized for tree-shaking (meaning every tiny function is exposed as ESM module), if you do not bundle anything at all, this easily amounts to crazy amounts of requests being made:
In our scenario, where we "just" user 5 components from our UI library, this amounts to +150 requests. Browsers limit the amount of parallel HTTP requests and if HTTPS involved, this is not going to get any faster... So what I am saying is, that even my beefy (sorry veggies!) MacBook takes roughly a second for loading. We limited the Playwright timeouts to 4s and it seems, that hosted AzureDevOps Mac OS agents have pretty bad I/O performance, read by factor 5-10 slower, so this explains for us failed timeouts, because the load event is not triggered in time, because esm modules need to be "resolved" before actual DOM processing can happen. We might think about using bundles for our tests; but for the time being, we solved this by having a platform-dependent global timeout set for Playwright. |
Same issue in chromium with fresh playwright version 1.31.2 :( Also, it's a little bit flaky |
Same issue with 1.32.3, out of 7 tests, 1 random one has always this problem. |
playwright 1.33.0, chrome still have this issue |
I noticed that it happens only in tests run in a docker container and only if I run a lot of tests. Interestingly Linux users do not report issues, only mac users. |
Can confirm this issue is affect linux users. I was setting up a docker container and trying playwright for the first time. Insanely frustrating. Finally figured out I'm not a total moron but simply a significant regression in playwright itself. I know npx is all the rage these days but it leads to users running the latest version. I was able to get my tests working by using npx [email protected] install and then npx [email protected] test after also adjusting the package.json dep to specifically 1.43.1 version. |
In my case updating Playwright to the latest versoin solved the issue, fyi |
This is still present when executed in Bitbucket CI/CD... Locally I am unable to reproduce... |
I noticed that |
I think this happens because of redirects. Does anyone experiencing this issue have redirects by any chance? |
I also have this issue using Chrome and Ubuntu (also using official container). The video shows the page freeze or hang a second after opening. This only happens on our Ubuntu env tests. |
I have performed some tests on local vs local docker vs k8s pod Hence recommend that those who see random TIMEOUTS (Test timeout of 30000ms exceeded) - check the resource usage |
This happens for me on locally on Windows btw, less often on UI mode though. Also happens in GitLab CI with Linux |
I now also get these locally on Windows but a lot more rarely |
What fixed it for me on Windows was setting |
I'm experiencing the same issue on v1.50.1. In my case specifically, Firefox is getting stuck after running 4 tests. |
for me, this happens to some url, while others are fine. |
I've experienced this issue once more, but found the root cause in my case. It was due to a Vite dev server websocket not being able to be opened. On Firefox it executes the first test without any issues, but the second test fails with the load event due to the websocket connection still waiting to be opened by the previous browser page. When I turn off the dev server completely and run it in preview mode, it does not occur. Looks like there might be some cleanup missing here in between closing a page after a test and opening a new page when a new test starts? |
I can also reproduce this issue. I'm using Playwright v1.51.1 with TypeScript, running both locally and on GitHub Actions (using the official image mcr.microsoft.com/playwright:v1.51.1-noble). But still, the page sometimes just doesn't load at all — exactly as described. To work around it, I even implemented a helper that retries "goto": It seems to be non-deterministic and not specific to a particular url or page (because my tests use only one url and page) — any insights or potential fixes would be much appreciated. I tried on Chrome and Firefox, Linux Ubuntu 24.04 and MacOS 15 Sequoia. I've used different LIRs with different bandwidth (from 100Mbps to 10G) — no effect. My best guess is that bug is somehow related to "domcontentloaded" or "load" event listener. |
This affects Chrome not just Firefox and happens quite often in CI. |
This also affects webkit. Only running into this in container. Please prioritize. |
I'm also seeing this with webkit in a docker container too. Very annoying and hard to switch browser types for our use case. Please fix this soon!
|
Hey folks, we need your help to fix this issue! If you struggle with this, please file a new issue with reproduction steps that we can run locally - fill in the "Bug Report" template and link to this issue. If you do not have a reproduction that we can run locally, for example it uses a non-public url, or you cannot share your code, please do not file an issue. When in doubt, please refer to the filing issues guide. Thank you everyone! |
@dgozman
Let me know what works best! |
Hello, For anyone running into this and ends up here through a search engine, it's worth a shot to enable "browser" debugging. (I also tried "api", but that did not reveal much.) Also, I recommend simply adding --retries 2 and use.video: "on-first-retry" to get an idea of what goes wrong.
(For us adding |
Closing this issue as there is no actionable repro to address. If you hit this problem, consider filing an issue with a repro as described in this comment. Thank you! |
Context:
headless: false,
args: [
'--width=1280',
'--height=720',
],
Script opens the nike.com url but stuck on goto. No additional requests in the devtool. Visually it stopes the loading, web site looks correct (with all css/js), but got never finishes
same behavior for waitUntill: domcontentloaded or any other
The text was updated successfully, but these errors were encountered: