-
Notifications
You must be signed in to change notification settings - Fork 214
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
Timeout Loading Test Suite in Chrome 75+ on DDC in Docker Container #1043
Comments
@kevmoo It's worth point out that this is only with Chrome 75 on Linux & DDC. dart2js works. earlier versions of chrome work. Chrome + DDC on Mac work. We're stumped. |
Related: #390 |
I don't know if this is related at all or just a coincidence, but it appears we are running into this problem on more packages as we update them to run on Dart 2.4 in CI. 🤷♂ |
Can you provide the Chrome process logs? I don't remember the exact details but I believe the compiling message is a bit of a misnomer as we also are waiting for the browser to connect during this time. If for some reason there is an issue with loading your application in Chrome the connect signal will never complete and thus we will time out. Often in that case there is a parsing / JS error that can be seen in the Chrome logs. |
@grouma I assume you're interested in the debugging log generated by passing This is how I've tried to go about generating it. I created a new override_platforms:
chrome:
settings:
arguments: --enable-logging --v=1 Then in my |
Hmm that's odd. I'm not familiar with this configuration as we spin up and capture Chrome logs quite differently internally. One thing you might want to try doing is modifying the test runner to print the
|
@grouma I'm curious, have you been able to repro the problem? |
No I have not. |
@grouma I printed out the |
Nothing in that file is helpful to me unfortunately. When I've seen load errors in the past, the log would contain a critical error. |
Is there anything else we can collect to help debug this? |
We're experiencing same problem, and actually it's blocker for us to move to latest Dart. How can we help with debug? @grouma |
Hmm, is there any way to get at the Chrome browser console logs? About a year ago, some of our larger internal customers would see "net::ERR_INSUFFICIENT_RESOURCES" messages. |
@todbachman-wf Can you try capturing the logs by printing |
If this is a network timeout issue, see: https://requirejs.org/docs/api.html#config-waitSeconds E.g., if the following appears before the
|
@grouma That's what I did when I produced the |
I've added an html file next to my dart test file to try to disable the requirejs timeout, but that doesn't seem to have helped. When we were debugging this in a Linux VM previously, Chrome wasn't reporting network timeouts, so this doesn't really surprise me. https://github.com/todbachman-wf/test_timeout_repro/blob/master/test/big_test.html |
@todbachman-wf it is a chrome >= 75 issue, can be fixed by adding '--disable-dev-shm-usage' to the chrome args. related issue: karma-runner/karma-chrome-launcher#198 |
OMG. I confirmed that fixed the issue for us @sinegovsky-ivan . Thanks for identifying the fix. |
@grouma - should we use this flag by default when we launch headless? I skimmed some of the linked issues but I don't fully understand the implications |
I wasn't familiar with the flag but did a bit of reading. I don't think there are really any consequences of using it. Chrome will basically be writing to |
Some of our larger internal Dart projects started hitting timeouts recently when running unit tests in CI. It seemed to start happening following the Chrome 75 release. None of the tests run, instead we get a timeout error before the first test suite loads, which looks similar to:
We don't see this when running the tests locally (on a Macbook Pro with Dart 2.3.2). I've run the tests for one of our failing projects using a local Ubuntu VM with Chrome 75 and don't see the issue there either.
Some things we tried initially, none of which resolved the issue:
We eventually stumbled upon 2 workarounds:
Since we couldn't reproduce this issue locally, only in CI, or as it turns out in a docker container, it was a bit tricky to debug. Eventually we attached remote Chrome dev tools to the Chrome instance running inside a docker container and watched the network as Chrome was downloading files. When we encountered the timeout, Chrome had clearly just stopped downloading files. So, we were fortunately able to come up with steps to reproduce the issue.
This project will reproduce the issue. It includes a library with 125 entry points (the code in them is identical) and a single unit test that imports and uses all of those entry points. I've included a Dockerfile that uses the google/dart:2.3.2 image as a base and runs the unit test first on Chromium (to demonstrate that it succeeds) and then on Chrome (on which it will fail).
When we run our docker containers in CI they are given 16GB of RAM and up to 50GB with swap memory included. I've been running the docker container in that repro on my machine and have been giving Docker 16GB as well.
Additionally, when I run the tests in that repo on an Ubuntu VM (in VirtualBox) with 16GB of RAM, the tests run just fine.
For what it is worth, initially my repro project had 1000 entry points, all of which were used by the unit test. With those 1000 entry points Chromium 73 was still able to download all the DDC-compiled modules and run the test; Chrome of course still failed. I started reducing the number of entry points until they started passing on Chrome. They started passing somewhere between 100 and 125. So it seems Chromium is able to handle loading at least an order of magnitude more files. I haven't tried to determine Chromium's breaking point.
When I was investigating the threshold for Chrome, I did run the tests in my Ubuntu VM as well. Ubuntu was failing with 1000 entry points. When I reduced the number of entry points to 500 the tests started passing.
At this point my suspicion is there is a bug in Chrome on Linux that has degraded its performance from Chrome 74 to Chrome 75. But I'm not 100% certain of that, particularly since the behavior is quite a bit different between a Linux VM and a Linux docker container. I'm hoping y'all might be able to shed more light!
The text was updated successfully, but these errors were encountered: