Protractor + xvfb + selenium test Hangs on Jenkins - javascript

I'm having this issue sometimes on my automated tests running remotely on Jenkins. About 30% of the times.
The error:
Tests hangs after this line:
"I/launcher - Running 1 instances of WebDriver"
It gets stuck at this step indefinitely and I have to stop execution (manually) or wait to timeout to take control of it.
I tried several known solutions that i found on this site but nothing changed on my results.
My config:
Ubuntu OS 14.04.5 on a headless cloud storage system.
xvfb
Jenkins 1.656
selenium-server-standalone-2.53.1
chromedriver_2.24linux64
geckodriver-v0.9.0
nodejs v0.10.37
node v6.3.1
npm 3.10.3
protractor Version 4.0.9
grunt-cli v1.2.0
grunt v0.4.5
jasmine v2.5.2
jasmine-core v2.5.2
Jenkins Job Config:
Jenkins downloads my test project from github and runs the following commands on Project's shell:
node node_modules/grunt-cli/bin/grunt testName:parameters
(I don't want to run grunt globally, thats why i execute it in this way.)
Is there anything i can try in order to solve this hang issue?
Thanks in advance!

Related

Vue app compiles successfully but does not load in browser

I have a Vue app that outputs the following in the console after npm run serve.
DONE Compiled successfully in 17450ms 2:15:55 PM
App running at:
- Local: http://localhost:8080/
- Network: http://10.0.0.72:8080/
Note that the development build is not optimized.
To create a production build, run npm run build.
No issues found.
However, the app will not load on http://localhost:8080/ . The page displays the "This site cannot be reached.The connection was reset." message.
Other pages load fine, including the Node server I am using for the backend, running on localhost:3002.
I have tried removing the node_modules and running npm install again, but that hasn't fixed it. With the app compiling ok there is little help troubleshoot. There are also no errors in the browser dev tools console.
Does anyone know what might be going wrong or how to debug this?
Thanks!
change your port with npm run serve --hostname 0.0.0.0 --port 4000 and then run again.

Open Cypress browser when running from Jenkins

I created in Jenkins a freestyle project in which I wanted to run Cypress.
In the command line I used this command line:
npx cypress run --browser chrome --headed --spec "cypress/integration/examples/actions.spec.js" --config pageLoadTimeout=10000
The issue that it runs silent mode, there is no browser that is open, and perform test actions.
What should I do so that the browser appears while executing the test? Thanks in advance.
CI tools like Jenkins aren't designed to open browser.
That is why Cypress offers two ways to run it:
For local dev/debug: cypress open
For CI/automatisation : cypress run
You are using it the right way.
Interesting things for CI are screenshots and videos.
Yes, actually when you launch tests based on Cypress on CI (not only Jenkins) - you can't watch the process in debug mode.
Only on the local machine with the open parameter.
Also, save the video OR screenshots of running tests from Jenkins - and look after

How to run nodemon + forever in the background

Good morning!
I need my node.js server running in the background. I just saw this answer: Forever + Nodemon running together
I understand the idea, and I think that it's great, but when I use
forever -c "nodemon --exitcrash" app.js
the nodemon console stills visible. How can I hide the console?
Thank you everyone!
Try using pm2 pm2 guides
With pm2 your application runs in the background and:-
Can auto-start on server reboots
You can even set pm2 to watch for file changes and reload your application
You can monitor your application and see resource utilization
You can view logs
You can run your application in cluster and load-balance requests using pm2

Meteor server crashes very frequently without any error

I am working with the Meteor application and I deployed the same over EC2 instance. It was working fine till a few days back.
But now the server process kill automatically without any error log or
console
I tried to get the error but unfortunately, as there are not any logs I am unable to find out why the server is crashing again and again.
I have a medium EC2 machine on which the application is running.
I am using nohup for running the application in the background.
Below is the command I used to start the server:-
nohup meteor --settings SETTINGS-PRODUCTION.JSON &
I am wondering to know about server crashes due to nohup or some other reason is there.
Please let me know how we can console uncaught exception in the meteor-like we do in express.
What should I use to auto restart the server if the process is killed
by any error or exception?
Any help would be much appreciated!
Thanks
Using nohup is quite a low-tech solution. Things like Phusion Passenger, PM2, or forever do a better job.
Also your docker container can be configured to automatically restart the process.
Even better is a tool called Meteor Up, which makes it really simple to deploy Meteor apps to EC2.
EASILY DEPLOY YOUR APP Meteor Up is a production quality Meteor app
deployment tool.
Install with one command:
$ npm install --global mup
http://meteor-up.com/

Karma "not found" in NetBeans after upgrading to Yosemite

I have a WAR project in NetBeans which uses Karma with Jasmine to unit-test the JavaScript files. The platform is Mac OS X. Things worked as they should under Mavericks, but after I upgraded to Yosemite, it no longer works, with the error message :
Failed to execute goal com.kelveden:maven-karma-plugin:1.8:start (default) on project Insight-war: There was an error executing Karma. Cannot run program "karma" (in directory "/Users/thja/Documents/Projects/kpi2010_core/WebGIS/Insight-war"): error=2, No such file or directory -> [Help 1]
It tries to execute the following command, as printed in the log:
karma start /Users/thja/Documents/Projects/kpi2010_core/WebGIS/Insight-war/src/main/webapp/config/karma.conf.js --browsers PhantomJS --reporters dots,junit --single-run --no-auto-watch --colors true
I can run the exact same command in the Terminal without a problem - it executes and give the test results. which karma gives the result /usr/local/bin/karma, and /usr/local/bin is part of the global PATH.
Is there any fix one can do for this, or do I just have to post an issue at the Maven Karma Plugin page?
Platform:
Mac OS X 10.10 Yosemite.
NetBeans 8.0.1
maven-karma-plugin 1.8
Java 1.7.0_45
It seems to be related to Yosemite turning off /etc/launchd.conf, so NetBeans doesn't get the correct PATH variable - so not directly related to Karma.
I fixed it by setting PATH=${PATH}:/usr/local/bin in netbeans.conf (within the NetBeans app package). Then the karma part of the build script runs successfully within NetBeans.

Categories