How to fix long running testcafe tests in CircleCI - automated-tests

I'm running my e2e TestCafe scripts in CircleCI 2.0. When I run these tests locally on my mac they take about ~3min. When they run via CircleCI, they typically take 10+ minutes.
Has anyone encountered this before?
I've tried clearing the Circle CI cache and using a different docker image (ie. image: circleci/node:8.9.4-browsers)

Had same issue, solved it by running tests in concurrency.
My script in package.json:
"test": "testcafe -c 5 chrome:headless tests/back-end -r xunit:/tmp/test-results/res.xml"
More info here:
https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/concurrent-test-execution.html
In paid version you can configure CPU and RAM resources for each job to make them faster:
https://circleci.com/docs/2.0/configuration-reference/#resource_class

Related

What is causing airflow webserver to fail and restart on docker for Mac?

I am trying to get Airflow running on a local Docker Desktop for Mac installation using the Quick Start instructions for a Docker installation at https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html. The install seems to go correctly, but when I start up the services using docker-compose up, all the services launch except for the webserver. That service starts, but then fails and restarts, over and over. The log shows this error:
EDIT: I found the issue in case someone else runs into it. The default configuration of Docker desktop for Mac doesn't allocate enough memory to run webserver. I bumped up the memory allocation in Docker, restarted everything, and all was good.
increasing the memory configuration of the docker worked for me
Edit:
Docs for docker configurations on mac: https://docs.docker.com/docker-for-mac/

Error: Chromium revision is not downloaded. Run "npm install" or "yarn install"

I am trying to run the following command but I am getting the error like
pa11y http://example.com/ # Trying to run this on my terminal
Welcome to Pa11y
------------------------
Error: Chromium revision is not downloaded. Run "npm install" or "yarn install"
at Launcher.launch (/usr/lib/node_modules/pa11y/node_modules/puppeteer/lib/Launcher.js:119:15)
at async runPa11yTest (/usr/lib/node_modules/pa11y/lib/pa11y.js:106:29)
at async pa11y (/usr/lib/node_modules/pa11y/lib/pa11y.js:55:19)
at async runProgram (/usr/lib/node_modules/pa11y/bin/pa11y.js:122:19)
I spent around 3-4 hours to fix this but no luck. I have tried every possible solution on the internet which is posted by others who had faced similar errors.
Any help in this regard is helpful
Two questions:
Do you have Chromium installed? pa11y doesn't think so! It could be a wrong version installed if so, or installed in a way that pa11y can't find.
What OS are you running?
The answer to your question depends on your Operating System, because the version of Chromium you need is specific to your OS! If you're running Linux Alpine,
the command would be something like this:
apk add -U --no-cache --allow-untrusted udev ttf-freefont chromium git
I had this problem when trying to run the Node package puppeteer (which uses Chromium) in a Docker container running node 12 alpine. I spent all weekend (yes...) to come to the 1 line (yes...) I needed. It turned out I needed to add the above line to my Dockerfile, which installs the necessary fonts and libraries and installs Chromium.
I also had to tell Puppeteer to skip installing Chromium, but I don't think that's applicable to your situation.
If you're running something other than Linux, check out these instructions for installing Chromium: https://www.chromium.org/getting-involved/download-chromium

Meteor Hanging on Ubuntu when building

I have an application that builds in 5 minutes on the Mac. When I try to build in Docker or directly in Ubuntu, the machine completely hangs at some point. It so bad that I can't even ssh into the machine. It eventually times out. I am using Meteor 1.4.2.3, Ubuntu 16.04 and Docker 16.04 with Meteor installed.
I thought maybe it was related to tar and 7z, so I upgraded tar and 7z. Still hangs. It hangs when I building on web.browser. There is high I/O waits and a bunch of blocked processes according to vmstat.
This is the command I'm running:
meteor build --allow-superuser --server-only --directory /tmp/build
Is their any way to get more info about what's going wrong? I also tried to
meteor remove ecmascript --allow-superuser
b/c one article said this may be an issue. Hangs.

Running 'grunt' command on mean.js app just stalling

I am following the installation guidelines as described on mean.js.org Everything seemed to install fine. I have all prereqs installed. I ran npm install after cloning the github repo and then tried to run grunt and I didnt get any errors however It seems to just be stalling on the command line. Last message on the command line is the "debugger is running on port 5858" and then it just sits there.
After some time the message [nodemon] watching 51,839 files - this might cause high cpu usage. To reduce use "--watch" comes up. I am on windows 10 and have all the latest versions of node,npm,grunt and mean.js. I am running the command line as admin.
Mean.js should be running on localhost:3000 but it is not.
This is intended.
There is an application invoked by the grunt command and running in background, watching your files for changes. In default configuration: nodemon and grunt-watch.
This will execute specific tasks based on the files you edited, such as linting JS files or compiling LESS files.
The cmd will probably show something when you edit files in the projects directory.

Behat tests fail at random

I test my Symfony2 project with PHPUnit and behat/mink. This morning I added more behat tests to my project and all of a sudden random tests started failing. It seems like I hit a limit (memory? execution time? something else?) but I can't find anything.
Travis-ci does not fail on this http://travis-ci.org/#!/tvlooy/ReadingCorner/builds/383016
My local machine does fail (Lenovo R60, 2GB RAM, 2x 1.8Ghz CPU). I run Fedora 16 on x86, 32bit. PHP 5.3.8 (cli), with Xdebug v2.1.2, PHPUnit 3.6.2.
(edit: I just updated to PHPUnit 3.6.4 and removed Xdebug but the problem remains)
I run my Behat tests with:
$ app/console behat -e=test
=> random tests fail
When I run the tests like this:
$ for feature in 'find src/Ctors/ReadingCornerBundle/Features/ -name *.feature'; do app/console behat -e=test $feature; done
=> all tests pass
I already raised my memory_limit in php.ini to 768M but it didn't help.
I have 7 feature files with a total of 57 scenario's. Not much, nothing exotic. The files are in https://github.com/tvlooy/ReadingCorner/tree/master/src/Ctors/ReadingCornerBundle/Features
I need the tests to work on my local machine in one command because I generate code coverage from it with PHPUnit (wrapped behat features in PHPUnit).
Any clues?
#jakub_zalas blogged about a fix. See http://www.zalas.eu/fixing-failing-behat-scenarios-in-large-suites
Setting 1002: 'SET SESSION wait_timeout=30;' fixed it for me too.
Please, run your features with -v and gist the output

Resources