How to prevent Docker's containers crash when running parallel tests using Zalenium - yoss123/test-automation-repo GitHub Wiki

Running parallel tests using Docker's Zalenium, consumes intensive CPU and Memory resources which sometimes make the containers crush. To prevent those crushes, we need to monitor the used resources on the running machine in order to increase the availability of the CPU and Memory resources AND to learn about the resources limitations of the machine we are running those tests on.

  1. Its recommended to close all running programs in order to free all the resources on the running machine so Zalenium can utilize as much as CPU & memory he need for the running parallel tests.

  2. Monitor the used resources of the machine when running the tests using Windows Task Manager.

  3. Monitor the used resources of the Zalenium containers by running the command 'docker stats' from PowerShell.

  4. If the CPU or memory exceeding 100% usage (viewed by the 'docker stats' command), consider increasing them using the Docker Desktop for Windows as described in the next link: https://docs.docker.com/docker-for-windows/#resources As parallel tests are usually high CPU consumers, its recommended to enable maximum usage of available CPU and 8GB of memory.

  5. When running Zalenium, disable the video recording (as it consumes a lot of memory) by running the next commands: docker run --rm -ti --name zalenium -p 4444:4444 `

>> -v /var/run/docker.sock:/var/run/docker.sock `

>> --privileged dosel/zalenium start --videoRecordingEnabled false

  1. Keep the PowerShell window open where you run Zalenium from to track exceptions or unwanted behavior when running the tests

  2. Don't open 'Zalenium Live Preview' while running the tests as it consumes a lot of I/O and CPU resources.