Open samhatoum opened 6 years ago
Comment by xywang68 Monday Oct 24, 2016 at 19:50 GMT
In the same file you mentioned (node_modules/chimp/dist/lib/cucumberjs/hooks.js) in line 17 there is this hard-coded step timeout value: 17 this.setDefaultTimeout(60 * 1000);
Comment by gferreri Monday Oct 24, 2016 at 21:42 GMT
I noticed that too, but I'm still not sure what is actually causing the timeout error.
Comment by radik Tuesday Nov 08, 2016 at 13:04 GMT
Does anybody know how to override that value globally?
You can change it for specific step definition like this:
module.exports = function () {
this.setDefaultTimeout(120 * 1000);
this.When(/^My step definition$/, function (table) {
});
};
Comment by kyleian Friday Nov 11, 2016 at 16:35 GMT
Out of curiosity where are you keeping your grid? Starting seeing this today when setting up a new grid behind a tight security group in AWS-OR.
Comment by kimeshan Friday Nov 11, 2016 at 17:54 GMT
+1 I have the exact same error. Running the tests on Chrome as well.
Comment by kyleian Friday Nov 11, 2016 at 18:04 GMT
As a resolution for my instance of this issue, having the 4444/5555 port settings configured in the security group as well as iptables config was the issue. I purged the iptables records and was able to get around this on initial session creation, though I still see the issue if the selenium node hasn't killed or is retrying previous sessions / the new chimp session is enqueued for that node.
Output on Grid Console:
1 requests waiting for a slot to be free. Capabilities [{rotatable=true, locationContextEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@4bd8e863, browserName=chrome, javascriptEnabled=true, handlesAlerts=true, platform=ANY, requestOrigins={name=webdriverio, version=4.2.16, url=http://webdriver.io}}]
Comment by kyleian Wednesday Nov 16, 2016 at 22:25 GMT
So far I've narrowed it down to this browser.initSync()
call that appears to have been removed here /merged into master 2 days ao, which lives in 0.41.2.
Commenting it out proceeds with the test suite and "begins" scenarios but kicks this up: Error: A session id is required for this command but wasn't found in the response payload
. Watching the console on the selenium node, the session claims to be done far earlier than I know it should be (1 minute on the dot, explaining the hook timeout?), leading me to believe maybe the chrome instance is never getting started on the node / chimp is waiting for said session ID to proceed.
https://gist.github.com/kyleian/6b651cbac0c0f3efac509dcbe06c5140
Comment by samhatoum Thursday Dec 15, 2016 at 13:58 GMT
Sorry this took so long for me to respond.
@kyleian is this chrome only? Does it work with Firefox/
Comment by javascriptlove Friday Dec 16, 2016 at 09:57 GMT
I have the same time to time with the latest chimp (0.45.0) and phantomjs. Not much info here though:
[32m
Master Chimp and become a testing Ninja! Check out our course: [39m[4m[34mhttp://bit.ly/2btQaFu
[39m[24m
[33m
[chimp] Running...[39m
/usr/lib/node_modules/chimp/node_modules/cucumber/lib/cucumber/runtime/event_broadcaster.js:30
throw error;
^
usr/lib/node_modules/chimp/dist/lib/cucumberjs/hooks.js:19 function timed out after 60000 milliseconds
Cucumber steps failed
Comment by samhatoum Friday Dec 16, 2016 at 12:02 GMT
This is likely happening because Phantomjs is erroring, then Cucumber is timing out. You should check to see what the issue is in Phantom first.
I strongly recommend against using Phantom for these exact reasons. It's not a real browser and I find myself fighting Phantom more than I'm writing tests
Comment by workflow Friday Jan 06, 2017 at 23:21 GMT
Thank you all for reporting and looking into this! We're seeing this about every 10th run on our CircleCI builds.
Chimp is 0.45.1 No PhantomJS used (ChromeDriver only)
Fun fact: On one of our local containers, I can't get it to run at all, times out every time. The configuration must the exact same as all other containers where it runs just fine (it's Docker, after all). Docker versions are identical, only difference that I can think of is the host operating system (Ubuntu 16.04 (failing) as opposed to Ubuntu 14.04 (working)) or perhaps some weird networking stuff.
Comment by dnajjar Wednesday Jan 11, 2017 at 22:04 GMT
We're seeing this sporadically in our CircleCI builds as well. Using Chimp is 0.46.0 and Chromedriver. Tests pass without fail in local environments using ChromeDriver.
Comment by kyleian Monday Feb 06, 2017 at 22:28 GMT
Sorry, missed that tagged response @samhatoum ; When I was dealing with this it was on a headless chrome session, did not try FF or phantom.
Comment by pmgouveia Tuesday Feb 14, 2017 at 09:13 GMT
Im also getting this error, because I have a routine that really needs to wait more than 60*1000 ms to pass...
to replicate..
const longTimeToWait = 10*60*1000;
this.When(/^timeout please$/,function() {
pause(longTimeToWait);
function pause(milliseconds) {
const dt = new Date();
while ((new Date()) - dt <= milliseconds) { /* Do nothing */ }
}
}
FIX:
const longTimeToWait = 10*60*1000;
this.setDefaultTimeout(longTimeToWait+1);
this.When(/^timeout please$/,function() {
pause(longTimeToWait);
function pause(milliseconds) {
const dt = new Date();
while ((new Date()) - dt <= milliseconds) { /* Do nothing */ }
}
}
solved with https://github.com/xolvio/chimp/issues/508#issuecomment-259130957
had some problems with timeout, because of asyncronous javascript! http://stackoverflow.com/questions/4122268/using-settimeout-synchronously-in-javascript#4122317
Comment by Heziode Wednesday Jun 14, 2017 at 14:29 GMT
Same issue:
node_modules/chimp/dist/lib/cucumberjs/hooks.js:20 function timed out after 60000 milliseconds
I've created a repo for reproduce this error: Chimp Headless Xvfb Chrome
Comment by Heziode Thursday Jun 15, 2017 at 13:26 GMT
Problem solve. Check my repo for using Chrome with Xvfb and Chimp.
Comment by defionscode Thursday Nov 09, 2017 at 16:13 GMT
This happens to me with headless chrome configured, on circle ci it seems to bomb out due to selenium standalone taking too long to install. As with others, locally it doesn't cause any problem. Is there a way to trigger the selenium installation prior to running chimp?
Meteor 1.6 Node 8.8.1 Chimp 0.50.2
my chimp config
module.exports = {
// - - - - WEBDRIVER-IO - - - -
ddp: "http://localhost:3000",
path: 'tests',
browser: 'chrome',
webdriverio: {
desiredCapabilities: {
chromeOptions: {
args: ["headless", "disable-gpu"]
},
isHeadless: true
}
},
seleniumStandaloneOptions: {
// check for more recent versions of selenium here:
// http://selenium-release.storage.googleapis.com/index.html
version: '3.7.1',
baseURL: 'https://selenium-release.storage.googleapis.com',
drivers: {
chrome: {
// check for more recent versions of chrome driver here:
// http://chromedriver.storage.googleapis.com/index.html
version: '2.33',
arch: process.arch,
baseURL: 'https://chromedriver.storage.googleapis.com'
}
}
}
};
Error output
[chimp] Running...
selenium-standalone installation [] 0% 0.0sselenium-standalone installation [] 0% 1.5sselenium-standalone installation [] 0% 1.4sselenium-standalone installation [] 0% 2.7sselenium-standalone installation [] 0% 2.5sselenium-standalone installation [] 0% 2.4sselenium-standalone installation [] 0% 2.2sselenium-standalone installation [] 0% 2.1sselenium-standalone installation [] 0% 2.0sselenium-standalone installation [] 0% 1.9sselenium-standalone installation [] 0% 1.8sselenium-standalone installation [] 0% 1.7sselenium-standalone installation [] 0% 2.4sselenium-standalone installation [] 0% 2.3sselenium-standalone installation [] 0% 2.2sselenium-standalone installation [] 0% 2.1sselenium-standalone installation [] 0% 2.0sselenium-standalone installation [] 0% 1.9sselenium-standalone installation [] 0% 1.8sselenium-standalone installation [] 0% 1.7sselenium-standalone installation [] 0% 2.0sselenium-standalone installation [] 0% 1.9sselenium-standalone installation [] 0% 1.8sselenium-standalone installation [] 0% 1.7sselenium-standalone installation [] 0% 1.6sselenium-standalone installation [] 0% 1.9sselenium-standalone installation [] 0% 1.8sselenium-standalone installation [] 0% 1.7sselenium-standalone installation [] 0% 1.6sselenium-standalone installation [] 0% 1.5sselenium-standalone installation [] 0% 1.4sselenium-standalone installation [] 1% 1.4sselenium-standalone installation [] 1% 1.6sselenium-standalone installation [] 1% 1.5sselenium-standalone installation [] 1% 1.3sselenium-standalone installation [] 1% 1.2sselenium-standalone installation [] 1% 1.5sselenium-standalone installation [] 1% 1.4sselenium-standalone installation [] 1% 1.6sselenium-standalone installation [] 1% 1.5sselenium-standalone installation [] 1% 1.4sselenium-standalone installation [] 1% 1.5sselenium-standalone installation [] 1% 1.4sselenium-standalone installation [] 1% 1.5sselenium-standalone installation [] 1% 1.4sselenium-standalone installation [] 1% 1.3sselenium-standalone installation [] 1% 1.4sselenium-standalone installation [] 1% 1.3sselenium-standalone installation [] 1% 1.2sselenium-standalone installation [] 2% 1.1sselenium-standalone installation [] 2% 1.2sselenium-standalone installation [] 2% 1.1sselenium-standalone installation [] 2% 1.0sselenium-standalone installation [] 2% 1.1sselenium-standalone installation [] 2% 1.0sselenium-standalone installation [] 2% 0.9sselenium-standalone installation [] 2% 1.0sselenium-standalone installation [] 2% 0.9sselenium-standalone installation [] 3% 0.9sselenium-standalone installation [] 3% 0.8sselenium-standalone installation [] 3% 0.9sselenium-standalone installation [] 3% 0.8sselenium-standalone installation [] 3% 0.9sselenium-standalone installation [] 3% 0.8sselenium-standalone installation [] 4% 0.8sselenium-standalone installation [] 4% 0.7sselenium-standalone installation [] 5% 0.8sselenium-standalone installation [] 5% 0.7sselenium-standalone installation [] 5% 0.8sselenium-standalone installation [] 5% 0.7sselenium-standalone installation [] 6% 0.7sselenium-standalone installation [] 6% 0.6sselenium-standalone installation [] 6% 0.7sselenium-standalone installation [] 6% 0.6sselenium-standalone installation [] 7% 0.6sselenium-standalone installation [] 8% 0.6sselenium-standalone installation [] 8% 0.5sselenium-standalone installation [] 8% 0.6sselenium-standalone installation [] 8% 0.5sselenium-standalone installation [] 9% 0.5sselenium-standalone installation [] 10% 0.5sselenium-standalone installation [] 11% 0.5sselenium-standalone installation [] 12% 0.5sselenium-standalone installation [] 13% 0.4sselenium-standalone installation [] 13% 0.5sselenium-standalone installation [] 13% 0.4sselenium-standalone installation [] 14% 0.4sselenium-standalone installation [] 15% 0.4sselenium-standalone installation [] 16% 0.4sselenium-standalone installation [] 17% 0.4sselenium-standalone installation [] 18% 0.4sselenium-standalone installation [] 19% 0.4sselenium-standalone installation [] 20% 0.4sselenium-standalone installation [] 21% 0.4sselenium-standalone installation [] 22% 0.4sselenium-standalone installation [] 22% 0.3sselenium-standalone installation [] 22% 0.4sselenium-standalone installation [] 22% 0.3sselenium-standalone installation [] 23% 0.3sselenium-standalone installation [] 24% 0.3sselenium-standalone installation [] 25% 0.3sselenium-standalone installation [] 26% 0.3sselenium-standalone installation [] 27% 0.3sselenium-standalone installation [] 28% 0.3sselenium-standalone installation [] 28% 0.4sselenium-standalone installation [] 29% 0.4sselenium-standalone installation [] 30% 0.4sselenium-standalone installation [] 31% 0.4sselenium-standalone installation [] 32% 0.4sselenium-standalone installation [] 33% 0.4sselenium-standalone installation [] 33% 0.3sselenium-standalone installation [] 34% 0.4sselenium-standalone installation [] 34% 0.3sselenium-standalone installation [] 34% 0.4sselenium-standalone installation [] 34% 0.3sselenium-standalone installation [] 34% 0.4sselenium-standalone installation [] 34% 0.3sselenium-standalone installation [] 34% 0.4sselenium-standalone installation [] 34% 0.3sselenium-standalone installation [] 35% 0.3sselenium-standalone installation [] 36% 0.3sselenium-standalone installation [] 37% 0.3sselenium-standalone installation [] 38% 0.3sselenium-standalone installation [] 39% 0.3sselenium-standalone installation [] 40% 0.3sselenium-standalone installation [] 41% 0.3sselenium-standalone installation [] 42% 0.3sselenium-standalone installation [] 43% 0.3sselenium-standalone installation [] 43% 0.4sselenium-standalone installation [] 43% 0.3sselenium-standalone installation [] 43% 0.4sselenium-standalone installation [] 43% 0.3sselenium-standalone installation [] 44% 0.3sselenium-standalone installation [] 45% 0.3sselenium-standalone installation [] 46% 0.3sselenium-standalone installation [] 47% 0.3sselenium-standalone installation [] 48% 0.3sselenium-standalone installation [] 49% 0.3sselenium-standalone installation [] 50% 0.3sselenium-standalone installation [] 51% 0.3sselenium-standalone installation [] 52% 0.3sselenium-standalone installation [] 53% 0.3sselenium-standalone installation [] 54% 0.3sselenium-standalone installation [] 55% 0.3sselenium-standalone installation [] 56% 0.3sselenium-standalone installation [] 57% 0.3sselenium-standalone installation [] 58% 0.2sselenium-standalone installation [] 59% 0.2sselenium-standalone installation [] 60% 0.2sselenium-standalone installation [] 61% 0.2sselenium-standalone installation [] 62% 0.2sselenium-standalone installation [] 63% 0.2sselenium-standalone installation [] 64% 0.2sselenium-standalone installation [] 65% 0.2sselenium-standalone installation [] 66% 0.2sselenium-standalone installation [] 67% 0.2sselenium-standalone installation [] 68% 0.2sselenium-standalone installation [] 69% 0.2sselenium-standalone installation [] 70% 0.2sselenium-standalone installation [] 71% 0.2sselenium-standalone installation [] 72% 0.2sselenium-standalone installation [] 73% 0.2sselenium-standalone installation [] 73% 0.1sselenium-standalone installation [] 74% 0.1sselenium-standalone installation [] 75% 0.1sselenium-standalone installation [] 76% 0.1sselenium-standalone installation [] 77% 0.1sselenium-standalone installation [] 78% 0.1sselenium-standalone installation [] 79% 0.1sselenium-standalone installation [] 80% 0.1sselenium-standalone installation [] 81% 0.1sselenium-standalone installation [] 82% 0.1sselenium-standalone installation [] 83% 0.1sselenium-standalone installation [] 84% 0.1sselenium-standalone installation [] 85% 0.1sselenium-standalone installation [] 86% 0.1sselenium-standalone installation [] 87% 0.1sselenium-standalone installation [] 88% 0.1sselenium-standalone installation [] 89% 0.1sselenium-standalone installation [] 90% 0.1sselenium-standalone installation [] 90% 0.0sselenium-standalone installation [] 91% 0.0sselenium-standalone installation [] 92% 0.0sselenium-standalone installation [] 93% 0.0sselenium-standalone installation [] 94% 0.0s
/root/repo/image_press/node_modules/chimp/node_modules/cucumber/lib/cucumber/runtime/event_broadcaster.js:30
throw error;
^
node_modules/chimp/dist/lib/cucumberjs/hooks.js:20 function timed out after 60000 milliseconds
Cucumber steps failed
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! image_press@ uattest: `chimp .chimp/chimp.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the image_press@ uattest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-11-09T16_08_18_506Z-debug.log
Exited with code 2
Comment by defionscode Thursday Nov 09, 2017 at 16:35 GMT
I attempted to invoke the selenium standalone installer prior to chimp running...and it seems that chimp runs it no matter what, even if it is already installed.
Comment by samhatoum Thursday Nov 09, 2017 at 16:55 GMT
There is yes, like this:
https://github.com/xolvio/qualityfaster/blob/dev/circle.yml#L26
https://github.com/xolvio/qualityfaster/blob/dev/scripts/download-chimp-dependencies.sh
It's a little hacky in that you have to start chimp with 0 params, but it does the trick of caching selenium for you
Comment by defionscode Thursday Nov 09, 2017 at 19:42 GMT
Hmm still get the same error
^C^[[Aroot@25a265655f4b:~/repo/image_press# ./node_modules/.bin/chimp --path=tmp/ --debug=true
(node:1197) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
Master Chimp and become a testing Ninja! Check out our course: http://bit.ly/2btQaFu
Chimp version: 0.50.2
ChromeDriver version: ChromeDriver 2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4)
Java version: openjdk version "1.8.0_151", OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12), OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
Selenium version: 3.0.1
Selenium drivers version: chrome: 2.28, ie: 3.0.0, firefox: 0.13.0
OS version: Linux 4.4.0-97-generic
Node version: v8.8.1
Browser version: chrome undefined
[chimp] Running...
/root/repo/image_press/node_modules/chimp/node_modules/cucumber/lib/cucumber/runtime/event_broadcaster.js:30
throw error;
^
node_modules/chimp/dist/lib/cucumberjs/hooks.js:20 function timed out after 60000 milliseconds
Cucumber steps failed
Then I tried it with my chimp.js (minus the path option) and same thing
root@25a265655f4b:~/repo/image_press# ./node_modules/.bin/chimp .tmp/chimp.js --debug=true --path=./tmp
Chimp version: 0.50.2
ChromeDriver version: Unknown. Chromedriver not used directly.
Java version: openjdk version "1.8.0_151", OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12), OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
Selenium version: 3.7.1
Selenium drivers version: chrome: 2.33, ie: 3.0.0, firefox: 0.13.0
OS version: Linux 4.4.0-97-generic
Node version: v8.8.1
Browser version: chrome undefined
[chimp] Running...
/root/repo/image_press/node_modules/chimp/node_modules/cucumber/lib/cucumber/runtime/event_broadcaster.js:30
throw error;
^
node_modules/chimp/dist/lib/cucumberjs/hooks.js:20 function timed out after 60000 milliseconds
Cucumber steps failed
Comment by defionscode Thursday Nov 09, 2017 at 21:16 GMT
Quick update, it seems this error appears if, not exclusively, if your selenium/chrome/driver stuff is borked. I ended up getting past this issue by using FROM circleci/node:8.8.1-browsers
as the base for my circleci docker image. Now I do not get the error.
For those interested my whole dockerfile is
FROM circleci/node:8.8.1-browsers
ENV OS_LOCALE="en_US.UTF-8"
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 8.8.1
RUN sudo apt-get update && sudo apt-get install -y locales
RUN sudo su root -c 'echo "LC_ALL=en_US.UTF-8" >> /etc/environment' \
&& sudo su root -c 'echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen' \
&& sudo su root -c 'echo "LANG=en_US.UTF-8" > /etc/locale.conf' \
&& sudo locale-gen en_US.UTF-8 \
&& sudo update-locale LANG=en_US.UTF-8
ENV LANG=${OS_LOCALE} \
LANGUAGE=en_US:en \
LC_ALL=${OS_LOCALE}
RUN sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
RUN echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
RUN sudo apt-get update && sudo apt-get install -y \
build-essential \
xdg-utils \
curl \
wget \
npm \
git \
mongodb-org \
libfontconfig \
unzip \
openjdk-8-jre-headless \
xvfb \
libxi6 \
libgconf-2-4 \
&& sudo rm -rf /var/lib/apt/lists/*
RUN mkdir ~/mongodata
RUN curl https://install.meteor.com | /bin/sh
Comment by 1996dylanriley Thursday Jan 25, 2018 at 21:22 GMT
I've been trying to solve this issie for 2 weeks now :( Im running headless chrome-stable via xvfb in ubuntu 14.04. The chimp config hasnt worked for me (specifying chrome headless and chromedriver version) which when ran with --browser=chrome updates chromedriver for you. Our tests are running but failing with firefox. Work perfect in chrome on windows. Anyone managed to solve it?
Comment by samhatoum Thursday Jan 25, 2018 at 22:38 GMT
are you able to share a reproducible repo for us?
with a CircleCI build? it would help resolve it quickly
Comment by 1996dylanriley Friday Jan 26, 2018 at 10:55 GMT
Unfortunately the project is not open-source. We are using docker to containerize a meteor app where we then test with chimp. Any particular circleci image you recommend for this?
Comment by defionscode Friday Jan 26, 2018 at 20:22 GMT
Small update, it seems that this issue creeps up again after updating to meteor 1.6.1
Comment by defionscode Friday Jan 26, 2018 at 20:43 GMT
After digging a bit deeper it seems you may also hit this issue post 1.6.1 update if you have dependencies that depend on Babel < 7 which can lead to your app not running properly (esp with a test driver).
Comment by 1996dylanriley Saturday Jan 27, 2018 at 23:09 GMT
I am actually running Meteor 1.5.2.1, its worth noting that I can successfully run the tests in firefox in the docker ubuntu environment. It seems to be a chrome only issue. Heres the chimp config i've been using:
module.exports = { // - - - - WEBDRIVER-IO - - - - ddp: "http://localhost:3000", path: './tests', browser: 'chrome', webdriverio: { desiredCapabilities: { chromeOptions: { args: ["headless", "disable-gpu"] }, isHeadless: true } }, seleniumStandaloneOptions: { // check for more recent versions of selenium here: // http://selenium-release.storage.googleapis.com/index.html version: '3.8.0', baseURL: 'https://selenium-release.storage.googleapis.com', drivers: { chrome: { // check for more recent versions of chrome driver here: // http://chromedriver.storage.googleapis.com/index.html version: '2.9', arch: process.arch, baseURL: 'https://chromedriver.storage.googleapis.com' } } } };
Issue by gferreri Monday Oct 24, 2016 at 17:16 GMT Originally opened as https://github.com/xolvio/chimp/issues/508
Expected behaviour
Running chimp cucumber/selenium tests through Travis CI using Chrome as the browser, I expect tests to run. However, the job fails with the error below. Previously, we successfully ran them using FIrefox.
Actual behaviour
Version & tools:
DEBUG=1 chimp tests/.config/chimp.js
Console / Log Output
Gist
Join our Slack xolv.io/community #chimp channel, where you can find help and help others.