-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
(RuntimeError) Wallaby had an internal issue with HTTPoison #365
Comments
Thanks for the report @stephaniewilkinson. Can you confirm what version of chrome and chromedriver you have installed? |
My Chrome is Version 66.0.3359.117 (Official Build) (64-bit) For phantomjs I didn't customize the version, just ran this:
I should probably mention the tests run fine before I try to switch to chrome. |
Thanks! All of that looks correct to me. We get those httppoison errors when there’s an issue communicating with chromedriver. Based on the stack trace it looks like it’s not able to create a new session which typically indicates an issue with wallabys ability to talk to chromedriver or chromedrivers ability to talk to chrome. |
Thanks! any ideas what to try next? |
What OS are you using? Are both chrome and chromedriver in your path? Other things to try might be trying out the latest elixir and otp version. |
Got an similar error:
Not sure if it's the same issue though. I'm running macOS 10.13.5, Chrome 67.0.3396.79, ChromeDriver 2.40.565386, Elixir 1.6.5 (compiled with OTP 20). |
We need to add more backoff and jitter to our http client. We see these issues when chromedriver starts to get overwhelmed with requests. |
@keathley any update here? Am running into the same issue:
I have chromedriver 2.36.540469 installed, Elixir 1.6.4 (compiled with OTP 20), Mac OS 10.13.5 |
I'm working on tracking down the root cause but so far no luck. Without a way to reliably re-produce this issue locally its very difficult to ensure we have a proper fix. If you have a test case that you can provide that would greatly assist the effort here. |
I've opened a PR that may help to reduce some of the issues that folks are seeing. If you would like to test out that branch locally that would be very useful. |
The PR is now on master so if you'd like to test with that it would be very appreciated. |
Sorry.. didn't work. Getting a similar error:
This seems to be only for me.. works fine on Circle CI and on other colleagues' machines. Not sure why this is. I can provide whatever you need but note that I'm an Elixir newb... |
I've been having a similar issue and realized that a lot of chrome and chromedriver processes had been accumulating - killing those fixes it for me. |
@evax Like they're being orphaned after running tests? @calvinkw1 Can you provide any other insights into what might be different on your machine? Different OS, chromedriver version, chrome version, etc.? Based on the error you posted it looks like chromedriver isn't even starting, hence the |
@keathley yes, though in that case if that helps I wasn't running the full test suite but giving |
I wonder if the cleanup script isn't being run correctly because of the umbrella or something similar. |
It could be because the path is relative to the app, so when you have multiple apps in an umbrella, it will likely only work for one app, the others display: |
Ah shoot. This is probably something I should have mentioned as well. I was passing in a specific file path rather than running the entire test suite. Running the entire test suite passes without issue.
Watching Also, if it matters, I work on a Ruby project that has |
@calvinkw1 The only thing I can think in that case would be that its not running the test_helper.exs when you run that specific file. Or that file isn't using the correct |
After using chromedriver+wallaby successfully on an elixir test suite for a while, I saw this issue for first time today. I remembered that last week while working on other projects I had fiddled around with my chromedriver install - I had a few ruby projects and wound up using the Anyway - I have the same chromedriver version installed ( When I manipulate my path to get the chromedriver installed via homebrew as the chromedriver that wallaby uses, everything is fine. When I update path to use the rbenv shim, I see the "Wallaby had an internal issue with HTTPoison" sort of errors described here. I'm not sure what if anything to do next to help debug what these installs are doing differently - but maybe this data point helps someone. Happy to do more if I can be useful. |
Thanks @mjankowski. It seems like something has changed recently and has broken our interactions with chromedriver. |
…sts off to it - we reliably received "(Runtime Error) Wallaby had an internal issue with HTTPoison" on the first test that gets run - adding this sleep at the outset of our feature test runs is far from ideal, but it solves the problem - see elixir-wallaby/wallaby#365 for more context
We also see
when running Wallaby tests in our two apps. In one app, we can set the test concurrency to 2 and the error goes away. In the other app, we always get the error unless we slow things down by increasing the jitter by forking Wallaby and by passing in our own implementation of def create_session(base_url, capabilities) do
Mutex.under(:chrome_session_mutex, :start_session, :infinity, fn ->
:timer.sleep(500)
Wallaby.Experimental.Selenium.WebdriverClient.create_session(base_url, capabilities)
end)
end We're using chromedriver 74.0.3729.6 installed via homebrew on MacOS. Are other people having success with chromedriver? |
@mhanberg Thanks so much for putting time into this. My coworker and I tried the branch, but neither of us saw any noticeable change in the frequency of the errors on our respective machines. Bummer :( I did an experiment where I ran our suite of 64 acceptance tests 100 times. The suite failed due to this error 43% of the time. When the suite failed, this error usually occurred on all 64 tests at once, though sometimes half of the tests would succeed and the other half would fail with the error. The error in question:
I'm happy to provide any other information on this issue. Thanks again for your time, it's much appreciated. |
@AndroidOatmeal is this happening on CI as well or only locally? What Chrome and ChromeDriver versions are you using? |
@mhanberg Yes, this issue occurs on CircleCI as well.
|
@AndroidOatmeal Do you mind sharing the contents of some of your failing tests and your support code? I think I found you on the Elixir Slack, so you can share it with me there if you like. Thanks! |
I'm not sure if this is related but I ran into this error today:
Chrome and Chromedriver versions are both 79.0.3945.xx I ran Experimenting a little more I get:
🤷♂ |
Any updates on this one? I also experiencing this kind of error when running |
@AndroidOatmeal @mhanberg I believe #518 should fix this problem. Would you mind trying again from master? |
@aaronrenner @mhanberg Thanks so much for putting this together. I updated my wallaby mix dependency to grab the latest version in
Unfortunately, I'm still experiencing the same |
I just tried out @mhanberg's wallaby_stress_test and see what you mean. I also found if I switched the driver to phantomjs, there wasn't that problem. The phantom driver uses a pool of phantomjs instances where the chromedriver one uses a single instance. I wonder if the stress test is just overwhelming the underlying chromedriver server and if building a pool of chromedriver instances would help? 🤔 |
What is strange is that even if you reduce the number of test modules to 2, it still explodes. I had the same thought regarding overwhelming chromedriver, but it is strange that chromedriver would crash with only two tests. |
I had a go at building a pool of chromedriver instances as @aaronrenner suggested. I think I may have had some success. I tried it on both my own test suite and on @mhanberg's wallaby_stress_test project and it seems to work. I was able to run tests with a concurrency equal to the number of cpu cores (in my case 20). I'm not at all familiar with poolboy, or the internals of wallaby, so it would be great if somebody with this experience could review my fork and make sure I'm going in the right direction. I would also be interested in hearing if this fixes the problem for everybody, or just me. What I've done so far is rough and untested but my employer is very keen to see this problem fixed and we're happy to invest the time to get a clean PR submitted as soon as possible if people think it would be accepted? A couple of things I definitely need clarification on:
|
@aarongraham Thanks so much for looking into this! I don't see where having a pool of Chromedriver servers would hurt, and I'm happy to hear it addresses your issue!
Supervisions wait for each child's init to complete before starting the next child, so blocking in the To address for phantomJS, I called wallaby/lib/wallaby/phantom.ex Lines 118 to 135 in 53befe0
This allows everything to start up in parallel and the waiting only occurs when
That sounds good to me. Thanks for doing some research on this and I'd be happy to play around with it as well. Please keep us posted on what you find! |
@aarongraham I just pushed a basic chromedriver pool on this branch that gets wallaby_stress_test passing: https://github.com/elixir-wallaby/wallaby/tree/ar-chromedriver-pool. It definitely slows down things quite a bit, but it seems like with some tuning we might get a speed benefit. I've also seen where chromedriver leaves chrome processes laying around after it closes. I'm not sure if its a bug in chromedriver, or if its the way our wrapper script is closing chromedriver improperly. However, the end result is it ends up slowing down the computer to a crawl if you run the test suite several times and don't kill the chrome instances afterwards. |
@aaronrenner it's possible that there might be some useful code in Chroxy, which "uses Elixir processes and OTP supervision to manage the chrome instances, as well as including a transparent proxy to facilitate automatic initialisation and termination of the underlying chrome page based on the upstream connection lifetime". |
@aaronrenner @aarongraham Happy Friday all. :) What's the status of the Chromedriver Pool branch? I've been using It would be nice to merge the fix into the main wallaby branch and finally close this issue. What work remains to be done? I'm happy to help out if the branch needs a bit more polish. |
Ran into this error today around 5 feature tests. |
had this error i could run the tests chrome headless but i needed it to work so i can see it running on the browser . What worked for me was configuring the timeouts https://hexdocs.pm/wallaby/0.23.0/readme.html#config Overriding a valueconfig :wallaby, hope this helps others |
@mhanberg @aaronrenner @aarongraham Sorry to @ you all, but I'm wondering if there is interest in merging Would you accept a PR merging that branch with |
@mhanberg @aaronrenner @aarongraham Hi guys. Sorry to be a pain, but I'd like a bit more visibility into the status of this. This particular issue affects many many users, and has remained open for four years now, with no solution or workaround in sight. If there are technical limitations here, I understand — that may affect our ability to resolve this issue. Can we at least get an update explaining the current status of this particular issue? Much appreciated 🙏 |
I'll get re acquainted with this and take another look. |
@mhanberg Thank you, I appreciate it. I can readily reproduce this error when running acceptance tests in parallel. I'm happy to assist if needed. |
This will open as many chromedrivers you have as cores, and partition them access to them based on your test pid. This effectively acts as a "pool" of chromedrivers without needing logic to check them in and out of the pool. It just acts as if there is a single chromedriver and it seems to just work. Related to #365
- see elixir-wallaby/wallaby#365 - shaves ~6s off local e2e tests. we may be able to take these values down further
* Start chromedriver with PartitionSupervisor This will open as many chromedrivers you have as cores, and partition them access to them based on your test pid. This effectively acts as a "pool" of chromedrivers without needing logic to check them in and out of the pool. It just acts as if there is a single chromedriver and it seems to just work. Related to #365 * ci: increase minimum elixir/otp versions * fix: add license for PartitionSupervisor Since we are vendoring this from the Elixir codebase, we attribute the project by providing its license in the file. * chore: format Formatting has changed since we have updated the minimum Elixir version. * chore: Add link to elixir-lang/elixir repo for vendored code * deps: Update Credo * chore: add NOTICE.md and update LICENSE.md * fix: Version mismatch of how to call IO.binread It seems that using `:all` with IO.binread has changed between v1.12 and v1.13, and is causing a Dialyzer problem. This patch adds some compile time logic to call it with the right argument based on the Elixir version.
Alright everyone, I think this can finally be closed. #692 should be the final fix and has been released as part of v0.30.0. Please note that the minimum Elixir version for Wallaby has been increased to v1.12. If this is a serious problem for you, please open an issue and we can discuss. If you think that you are still seeing this problem, please open another issue. This one is too long and the codebase has shifted so much since it was created that a lot of the code examples and errors shared here are out of date/no longer relevant. |
Issue
When I switch to using Chrome, I get this error:
Versions:
elixir: "~> 1.4",
Test Code & HTML
Here's my test:
Here's my FeatureCase:
Here's my HTML:
<h1 class="header center">Welcome to School!</h1>
Thanks for any help you can give!
The text was updated successfully, but these errors were encountered: