Restart browser if it became unresponsive
Are you requesting a feature or reporting a bug?
Feature
What is the current behavior?
When browser becomes unresponsive (XXX browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.) we stop all running tests.
What is the expected behavior?
Unresponsive browser can be closed, and a new browser instance can be started on the next or even the same test (e.g. if quarantine mode is enabled).
How would you reproduce the current behavior (if this is a bug)?
???
Specify your
- testcafe version: 0.17.2
- node.js version: any
Hi, we are having the same issue with testcafe 0.17.2 with a couple of tests running in Bamboo CI that sometimes fails because of this error. It would be great if you can work on this ticket. Below is the stacktrace.
12-Oct-2017 10:43:40 | ERROR The Chrome 53.0.2785 / Linux 0.0.0 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.
-- | --
12-Oct-2017 10:43:40 |
12-Oct-2017 10:43:40 | Type "testcafe -h" for help.
12-Oct-2017 10:43:40 |
12-Oct-2017 10:43:40 | npm ERR! Linux 4.8.0-1.el7.elrepo.x86_64
12-Oct-2017 10:43:40 | npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "test-ci" "tests"
12-Oct-2017 10:43:40 | npm ERR! node v6.7.0
12-Oct-2017 10:43:40 | npm ERR! npm v3.10.3
12-Oct-2017 10:43:40 | npm ERR! code ELIFECYCLE
12-Oct-2017 10:43:40 | npm ERR! [email protected] test-ci: `testcafe 'chromium --no-sandbox' -s ./screenshots --screenshots-on-fails --color "tests"`
12-Oct-2017 10:43:40 | npm ERR! Exit status 1
12-Oct-2017 10:43:40 | npm ERR!
12-Oct-2017 10:43:40 | npm ERR! Failed at the [email protected] test-ci script 'testcafe 'chromium --no-sandbox' -s ./screenshots --screenshots-on-fails --color "tests"'.
12-Oct-2017 10:43:40 | npm ERR! Make sure you have the latest version of node.js and npm installed.
12-Oct-2017 10:43:40 | npm ERR! If you do, this is most likely a problem with the testcafe package,
12-Oct-2017 10:43:40 | npm ERR! not with npm itself.
12-Oct-2017 10:43:40 | npm ERR! Tell the author that this fails on your system:
12-Oct-2017 10:43:40 | npm ERR! testcafe 'chromium --no-sandbox' -s ./screenshots --screenshots-on-fails --color "tests"
12-Oct-2017 10:43:40 | npm ERR! You can get information on how to open an issue for this project with:
12-Oct-2017 10:43:40 | npm ERR! npm bugs testcafe
12-Oct-2017 10:43:40 | npm ERR! Or if that isn't available, you can get their info via:
12-Oct-2017 10:43:40 | npm ERR! npm owner ls testcafe
12-Oct-2017 10:43:40 | npm ERR! There is likely additional logging output above.
12-Oct-2017 10:43:40 |
12-Oct-2017 10:43:40 | npm ERR! Please include the following file with any support request:
12-Oct-2017 10:43:40 | npm ERR! /apps/testcafe/npm-debug.log
12-Oct-2017 10:43:41 | Tests failed
It also happens with testcafe 0.18.1
Annoying issue. Any ETA here? :) 0.18.5 still has it
I'm having the same problem. I thought it was related to local execution but our client experiences the same on his machine.
Hi,
Thanks for your interest. This issue is in our plans to the one of the next releases.
My observation is if we run bulk test cases in one Browser then only face this issue. @AlexanderMoskovkin : what is your thought on this. I have allready Opened the issue : https://github.com/DevExpress/testcafe-browser-provider-browserstack/issues/25
Hi 👋 @AndreyBelym @AlexanderMoskovkin We also have this kind of problem when Testcafe became unresponsive. We are running tests with concurrency 1 in Chrome. And usually, it fails when the time of execution reaches 20+ minutes.
{ Error: The Chrome 64.0.3282 / Linux 0.0.0 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.
at Timeout.<anonymous> (/node_modules/testcafe/lib/browser/connection/index.js:226:34)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5) constructor: [Function: GeneralError] }
I also got this issue when I was debugging test with VSCode debugger for some time. Look like for us there is some kind of timeout reached on 25th-minute point 🤔
I hope that can help you investigate this issue.
Can we get this feature implemented in ASAP - @AndreyBelym / @AlexanderMoskovkin? This issue is very annoying and blocking our test execution on Safari, Firefox (& maybe Edge/IE). We are still seeing this issue in the latest TestCafe version 0.20.0-alpha.1 ? Please let me know if I can help provide any additional debug logs. I already provided some logs here - https://testcafe-discuss.devexpress.com/t/browser-disconnected-error-this-problem-may-appear-when-a-browser-hangs-or-is-closed-or-due-to-network-issues/383
Hi @sijosyn, we plan to implement this feature in next sprint (0.21.0 version). We'll let you know when the dev build will become available.
I have face same issue with browsers stack site when I am executing my application over there.
On Fri, Apr 27, 2018, 7:07 AM Sijo Cheeran [email protected] wrote:
Can we get this feature implemented in ASAP - @AndreyBelym https://github.com/AndreyBelym / @AlexanderMoskovkin https://github.com/AlexanderMoskovkin? This issue is very annoying and blocking our test execution on Safari, Firefox (& maybe Edge/IE). We are still seeing this issue in the latest TestCafe version 0.20.0-alpha.1 ? Please let me know if I can help provide any additional debug logs. I already provided some logs here - https://testcafe-discuss.devexpress.com/t/browser-disconnected-error-this-problem-may-appear-when-a-browser-hangs-or-is-closed-or-due-to-network-issues/383
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DevExpress/testcafe/issues/1815#issuecomment-384837593, or mute the thread https://github.com/notifications/unsubscribe-auth/ARx2vFJa_-G0DKXd21qru-SvF-3iQmQtks5tsnZ2gaJpZM4PjBVK .
Any ETA for it's fix? I am using this testcafe version 0.18.6 now
Any update on this? I have a couple of suites running on Jenkins and randomly stop because of this... I am really thinking about creating a daemon to keep checking the job and re-start everything in case it hangs like this, but that doesn't seem like a good solution... is this going out already?
Is there a way to contribute code to this issue? I would like to help in any way possible. Thanks
Hi @berrutti, any contributions are welcome. I think all things that should be changed lies on https://github.com/DevExpress/testcafe/blob/master/src/browser/connection/index.js, look at the _waitForHeartbeat function. If you make a PR, I can help with tests and can answer any questions that will arise.
TestCafe should restart the browser when the latter starts to slow down.
I suggest using the following algorithm:
- implement a user-defined option to specify the memory usage limit
- track the browser memory usage (only for IE) and restart the browser when it exceeds this limit
Hello! I'm also very need this feature: track the browser memory usage (only for IE) and restart the browser when it exceeds this limit Thanks!
What kind of workarounds have people implemented? We saw this on IE only and so we are thinking of running firefox and chrome in parallel and then IE after that in series but if the issue is affecting all browsers as some are reporting then I dont see that as a viable solution.
Hello, we have the same issue for Chrome and Firefox on CircleCI with Testcafe v.1.0.1, any updates on this issue? thanks
Same issue here on chromium:headless with --no-sandbox flag. Happening occasionally in different tests.
@valerii-cognite, have you tried the --disable-dev-shm-usage Chrome flag?