Hi, After I upgraded my docker desktop on 20/Apr/2021, I found my tests are all skipped when I run tests using docker images, and seems the error message below is the root cause --- it is showing that chrome is failed to start, and chrome location /usr/bin/google-chrome is no longer running.

Step 1: Start selenium hub, selenium chrome & selenium firefox containers
Command: docker-compose up -d hub chrome firefox
Step 2: Start my automation script
Command: docker-compose up bdd
All containers should be up & the chrome driver should start and execute tests written in the code ( I declared to use chrome only in my test script so it won't start firefox)
Current faulty behavior:
chrome failed to start

Tests are all skipped

OS: Linux
Docker-Selenium image version:
selenium/node-chrome:latest
DIGEST:sha256:f60f1c6e2fe2fb6a9a74adb2425175aaf502ce1c1a095d412ce6c24ab89bf2f7
selenium/node-firefox:latest
DIGEST:sha256:77f17b418e821d68e0c6e6a699f7fd07b93524eae3bd75b482f40aa674ebdd87
selenium/hub:latest
DIGEST:sha256:ebcbc572f52820546a0e6094e7a0d8c4d9ffc4ec9c5557cb7af63d3aaad93161
Docker version:
Client: Docker Engine - Community
Cloud integration: 1.0.12
Version: 20.10.5
API version: 1.41
Go version: go1.13.15
Git commit: 55c4c88
Built: Tue Mar 2 20:14:53 2021
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.5
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 363e9a8
Built: Tue Mar 2 20:15:47 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.4
GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
runc:
Version: 1.0.0-rc93
GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Docker-Compose version (if applicable):
Don't know how to check the version
Exact Docker command to start the containers (if using docker-compose, provide
the docker-compose file as well):
Step 1: docker-compose up -d hub chrome firefox
Step 2: docker-compose up bdd
Docker compose file:
version: "3"
services:
hub:
image: selenium/hub:latest
ports:
- "4444:4444"
chrome:
image: selenium/node-chrome:latest
depends_on:
- hub
environment:
- HUB_HOST=hub
volumes:
- /dev/shm:/dev/shm
firefox:
image: selenium/node-firefox:latest
depends_on:
- hub
environment:
- HUB_HOST=hub
bdd:
image: icemeetscoke/uiautomation
depends_on:
- chrome
- firefox
environment:
- HUB_HOST=hub
volumes:
- C:\Users\ryanchen\WorkSpaces\LogixPanel\test-result:/usr/share/automation/target/html
How can we reproduce that? Our CI tests for the release done yesterday pass without problems. Is this happening in all machines you try that? Only on your machine?
If you provide some tests to reproduce the issue, we'd be happy to help troubleshooting it.
Hi Diemol,
Thanks for responding.
I only tried on my machine. But from my understanding, the tests are running on docker containers which to me means it doesn't matter what machine you are using. (Please forgive me if my understanding is wrong).
Also, I am trying to figure out what do you mean by 'provide some tests to reproduce the issue'. It would be great if you could tell me what details I need to give.
I'm still a newbie using selenium docker, thanks for your patience!
Hi, I provided you my project image for you to troubleshooting if you think that would be helpful.
docker pull icemeetscoke/uiautomation:latest
Step 1: Run command under the directory which has the docker compose file.
Command: docker-compose hub chrome firefox
Step 2: After selenium hub/chrome/firefox containers are all up, run below command to start my project.
Command: docker-compose bdd
If everything went correct, you would see the error looks like the below screenshots:
chrome failed to start

Tests are all skipped

Would it be possible to have a sample code in a GitHub repo or here pasted as a comment (if it is small enough)? I need to see what test case I am running to spot the issue.
Just commenting that I'm currently seeing this issue as well, I'm using the docker-compose straight from this repo, my tests are written with js.
When I construct my driver, I am simply calling ".forBrowser" and ".usingServer", so I'm currently in a pretty vanilla state. I am not able to use chrome, firefox is working however. Just wanted to put my hat in the ring that I saw this issue with the latest update, while having a very barebones test project.
@diemol
Please see my project:
https://github.com/IceMeetsCoke/LogixPanel-UIAutomation.git
I'm using a Behavior-driven framework, so the StepDefinitions folder has all the steps that need to be executed, and all these steps are linked with feature files. TestRunner.java is the file to run the test cases, and I use CucumberOptions to identify feature files I want to run, as well as StepDefinition files.
So to answer your question - "I need to see what test cases I am running to spot the issue". you can find all test cases in src/test/resources/features
@ThatOhio Hi, can you share the error messages? Did you get the same error messages as mine?
@diemol Hi Diemol, do you have a chance to have a look into this issue? Please let me know if there are any concerns.
I've also started seeing this. I suspect it might be related to the /dev/shm volume mount as removing that fixes things for me. I haven't got the corresponding flag though.
This looks like issue with latest docker update in windows and the image. For me everything worked the day before then docker update happened and then it just stopped working with the same issue above. The error above occurs for 4.0.0-beta-3-prerelease-20210402 and 4.0.0-beta-3-prerelease-20210422. It works if I spin these images on my mac or linux boxes. As for the latest beta image it's a whole another issue as doesn't even know what chrome is
So far what I can see while running on macOS Big Sur is that things work, I went to https://github.com/IceMeetsCoke/LogixPanel-UIAutomation and did:
docker-compose up -d hub chrome firefox
docker-compose up bdd
Will try shortly on a Windows machine.
EDIT: To be more precise, not everything works, I get some SQL errors but that is unrelated to Selenium.
I can see that the provided docker-compose file fails in Windows. Seems to be related to the /dev/shm mount.
I replaced that with shm_size and it worked. It is probably a bug in Docker Desktop for Windows. This is the working docker compose file.
version: "3"
services:
hub:
image: selenium/hub:3.141.59-20210422
ports:
- "4444:4444"
chrome:
image: selenium/node-chrome:3.141.59-20210422
depends_on:
- hub
environment:
- HUB_HOST=hub
shm_size: '2gb'
firefox:
image: selenium/node-firefox:3.141.59-20210422
depends_on:
- hub
environment:
- HUB_HOST=hub
shm_size: '2gb'
bdd:
image: icemeetscoke/uiautomation
depends_on:
- chrome
- firefox
environment:
- HUB_HOST=hub
volumes:
- C:\Users\diemol\Downloads\test-result:/usr/share/automation/target/html
I will close this since there is a workaround, and the issue is not related to docker selenium.
In my case for similar issue solution for chrome is adding extra arguments such:
"goog:chromeOptions": {
args: [
"--start-maximized",
"--no-sandbox",
"--disable-dev-shm-usage"
],
--disable-dev-shm-usage - solved issue for chrome
Most helpful comment
I can see that the provided docker-compose file fails in Windows. Seems to be related to the
/dev/shmmount.I replaced that with
shm_sizeand it worked. It is probably a bug in Docker Desktop for Windows. This is the working docker compose file.I will close this since there is a workaround, and the issue is not related to docker selenium.