zalando / zalenium

A flexible and scalable container based Selenium Grid with video recording, live preview, basic auth & dashboard.
https://opensource.zalando.com/zalenium/
Other
2.39k stars 574 forks source link

Using USE_NET_HOST takes 2½ minutes and returns an error code #192

Closed schlomo closed 7 years ago

schlomo commented 7 years ago

I want to point the selenium tests at a service running on my local machine, therefore I start Zalenium with the USE_NET_HOST=true environment variable set. That way running my selenium tests works well.

The problem is that

  1. it takes 2½ minutes to start Zalenium
  2. the return code to the shell is 4 and not 0, indicating an error while it actually works.

Here is the output:

sschapiro@zalando-26723:~$ time curl -sSL https://raw.githubusercontent.com/dosel/t/i/p | env USE_NET_HOST=true bash -s start ; echo RETURN_CODE: $?
Checking dependencies... Done Checking dependencies.
latest: Pulling from dosel/zalenium
Digest: sha256:f17d8ba75b3677a2d66a42417d2b011ca0ac080a1f4b21664d2a3c4030600368
Status: Image is up to date for dosel/zalenium:latest
latest: Pulling from elgalu/selenium
Digest: sha256:eb49a354d1b77d2e8fbcf43d5222745d14056e500ab47c5f78a749e096ff746f
Status: Image is up to date for elgalu/selenium:latest
Starting Zalenium in docker...
WARN: Sauce Labs will not be enabled because the var $SAUCE_USERNAME is NOT present
WARN: BrowserStack will not be enabled because the var $BROWSER_STACK_USER is NOT present
WARN: Testing Bot will not be enabled because the var $TESTINGBOT_SECRET is NOT present
2451f418b31a6b4aabc4eea98434451fc3e3f635426527147bd0cef0d2102507
..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Zalenium failed to start after 2 minutes, failing...
Docker binary already present, will use that one.
usermod: no changes
stat: /var/run/docker.sock:: 27
sudo groupadd --gid 27 docker:: groupadd: GID '27' already exists
-- LOG 17:31:37:169566982 Error while sudo groupadd --gid 27 docker
Docker version 17.06.0-ce, build 02c1d87
-- LOG 17:31:37:225226145 Ensuring docker works...
-- LOG 17:31:37:262064631 Ensuring no stale Zalenium related containers are still around...
-- LOG 17:31:37:274571052 Ensuring docker-selenium is available...
-- LOG 17:31:37:291676677 Running additional checks...
haveged: haveged starting up
Copying files for Dashboard...
Starting Nginx reverse proxy...
Starting Selenium Hub...
.17:31:37.556 INFO - Selenium build info: version: '3.3.1', revision: '5234b32'
17:31:37.557 INFO - Launching Selenium Grid hub
...17:31:38.158 INFO - binding de.zalando.ep.zalenium.servlet.LivePreviewServlet to /grid/admin/LivePreviewServlet/*
17:31:38.160 INFO - binding de.zalando.ep.zalenium.servlet.ZaleniumConsoleServlet to /grid/admin/ZaleniumConsoleServlet/*
17:31:38.161 INFO - binding de.zalando.ep.zalenium.servlet.ZaleniumResourceServlet to /grid/admin/ZaleniumResourceServlet/*
17:31:38.162 INFO - binding de.zalando.ep.zalenium.dashboard.DashboardCleanupServlet to /grid/admin/DashboardCleanupServlet/*
.17:31:38.236 INFO - Will listen on 4445
17:31:38.359 INFO - Nodes should register to http://172.17.0.1:4445/grid/register/
17:31:38.359 INFO - Selenium Grid hub is up and running
Selenium Hub started!
Starting DockerSeleniumStarter node...
..17:31:38.880 INFO - Selenium build info: version: '3.3.1', revision: '5234b32'
17:31:38.880 INFO - Launching a Selenium Grid node
.2017-07-20 17:31:39.253:INFO::main: Logging initialized @597ms to org.seleniumhq.jetty9.util.log.StdErrLog
17:31:39.294 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
 registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
17:31:39.294 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
 registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
17:31:39.294 INFO - Driver class not found: com.opera.core.systems.OperaDriver
17:31:39.295 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
17:31:39.295 INFO - Driver class not found: com.opera.core.systems.OperaDriver
17:31:39.296 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
17:31:39.297 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
 registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX
.2017-07-20 17:31:39.333:INFO:osjs.Server:main: jetty-9.2.20.v20161216
2017-07-20 17:31:39.363:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@cd3fee8{/,null,AVAILABLE}
2017-07-20 17:31:39.373:INFO:osjs.AbstractConnector:main: Started ServerConnector@50a638b5{HTTP/1.1,[http/1.1]}{0.0.0.0:30000}
2017-07-20 17:31:39.374:INFO:osjs.Server:main: Started @718ms
17:31:39.374 INFO - Selenium Grid node is up and ready to register to the hub
17:31:39.384 INFO - Registering the node to the hub: http://localhost:4444/grid/register
17:31:39.644 INFO - SessionCleaner initialized with insideBrowserTimeout 0 and clientGoneTimeout 1800000 polling every 180000
....17:31:40.445 INFO - [DS] Capabilities grabbed from the docker-selenium image
17:31:40.450 INFO - Registered a node http://172.17.0.1:30000
17:31:40.451 INFO - The node is registered to the hub and ready to use
17:31:40.453 INFO - [DS]  Setting up 2 nodes...
17:31:40.461 INFO - 2 containers were created, it will take a bit more until all get registered.
DockerSeleniumStarter node started!
Sauce Labs not enabled...
Browser Stack not enabled...
TestingBot not enabled...
Zalenium is now ready!
*************************************** Data Processing Agreement ***************************************
By using this software you agree that the following non-PII (non personally identifiable information)
data will be collected, processed and used by Zalando SE for the purpose of improving our test
infrastructure tools. Anonymisation with respect of the IP address means that only the first two octets
of the IP address are collected.

See the complete license at https://github.com/zalando/zalenium/blob/master/LICENSE.md
*************************************** Data Processing Agreement ***************************************
17:31:46.832 INFO - Registered a node http://localhost:40000
17:31:46.856 INFO - Registered a node http://localhost:40001
17:31:47.076 INFO - [DS] Container zalenium_40001 is up after ~5 seconds...
17:31:47.089 INFO - [DS] Container zalenium_40000 is up after ~5 seconds...

real    2m6,238s
user    0m11,166s
sys 0m7,431s
RETURN_CODE: 4
elgalu commented 7 years ago

OSX?

schlomo commented 7 years ago

Linux Ubuntu

Am 20.07.2017 7:19 nachm. schrieb "Leo Gallucci" notifications@github.com:

OSX?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zalando/zalenium/issues/192#issuecomment-316772277, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGMCNNuH2fMYPfDpLj2rmFIwhgtQuMeks5sP4wygaJpZM4OeUT6 .

elgalu commented 7 years ago

It's a bug in the one-liner script, I can recreate.

Thanks for finding this! I will mark it to fix later.

In the meantime you can use -i for interactive mode ... bash -s start -i

elgalu commented 7 years ago

Should be fixed now!

schlomo commented 7 years ago

Thanks a lot, now it is down to 10 seconds and a clean exit code. Thank you very much for the quick fix!

sschapiro@zalando-26723:~$ time curl -sSL https://raw.githubusercontent.com/dosel/t/i/p | env USE_NET_HOST=true bash -s start ; echo RETURN_CODE: $?
Checking dependencies... Done Checking dependencies.
latest: Pulling from dosel/zalenium
Digest: sha256:f17d8ba75b3677a2d66a42417d2b011ca0ac080a1f4b21664d2a3c4030600368
Status: Image is up to date for dosel/zalenium:latest
latest: Pulling from elgalu/selenium
Digest: sha256:eb49a354d1b77d2e8fbcf43d5222745d14056e500ab47c5f78a749e096ff746f
Status: Image is up to date for elgalu/selenium:latest
Starting Zalenium in docker...
WARN: Sauce Labs will not be enabled because the var $SAUCE_USERNAME is NOT present
WARN: BrowserStack will not be enabled because the var $BROWSER_STACK_USER is NOT present
WARN: Testing Bot will not be enabled because the var $TESTINGBOT_SECRET is NOT present
45916a8be9b6d45a699d9592b461525462ce7c9f1caea77389e19e4d189b3f37
...............Zalenium in docker started!

real    0m10,389s
user    0m0,506s
sys 0m0,220s
RETURN_CODE: 0
sschapiro@zalando-26723:~$ docker ps
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS               NAMES
014b9781d6f7        elgalu/selenium:latest   "entry.sh"               15 seconds ago      Up 14 seconds                           zalenium_40001
e08b0e0e5ab2        elgalu/selenium:latest   "entry.sh"               15 seconds ago      Up 14 seconds                           zalenium_40000
45916a8be9b6        dosel/zalenium:latest    "entry.sh start --..."   19 seconds ago      Up 18 seconds                           zalenium