Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start php bdd with parallel process using 4 proxy containers #15

Open
fergadipaolx opened this issue Jan 11, 2017 · 2 comments
Open

Comments

@fergadipaolx
Copy link

fergadipaolx commented Jan 11, 2017

Currently, we want to implement parallel processes in our automation testing because it took long time about 1 hour 35 minutes in single process.
So we have 1 selenium hub container, 4 proxy containers and 4 chrome-debug containers which every proxy container connected to chrome-debug container each other.
Here is the result of athena info command :

 [INFO] Running containers [image|container|status]:
 
  * selenium/node-chrome-debug  athena-selenium-0-chrome-debug-9999  [UP]  To access it use http://192.168.99.100:9999
  * selenium/node-chrome-debug  athena-selenium-0-chrome-debug-9998  [UP]  To access it use http://192.168.99.100:9998
  * selenium/node-chrome-debug  athena-selenium-0-chrome-debug-9997  [UP]  To access it use http://192.168.99.100:9997
  * selenium/node-chrome-debug  athena-selenium-0-chrome-debug-9996  [UP]  To access it use http://192.168.99.100:9996
  * selenium/hub                athena-selenium-0-hub                [UP]
  * olx/athena-proxy            athena-plugin-proxy-0-1004           [UP]  To access it use http://192.168.99.100:9091-9999,1004
  * olx/athena-proxy            athena-plugin-proxy-0-1003           [UP]  To access it use http://192.168.99.100:9091-9999,1003
  * olx/athena-proxy            athena-plugin-proxy-0-1002           [UP]  To access it use http://192.168.99.100:9091-9999,1002
  * olx/athena-proxy            athena-plugin-proxy-0-1001           [UP]  To access it use http://192.168.99.100:9091-9999,1001

Here is the result of docker ps :

 CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                                   NAMES
 129384d02cf7        selenium/node-chrome-debug:latest   "/opt/bin/entry_point"   18 minutes ago      Up 18 minutes       0.0.0.0:9999->5900/tcp                  athena-selenium-0-chrome-debug-9999
 2af31ff00b78        selenium/node-chrome-debug:latest   "/opt/bin/entry_point"   18 minutes ago      Up 18 minutes       0.0.0.0:9998->5900/tcp                  athena-selenium-0-chrome-debug-9998
 0dc92780aa02        selenium/node-chrome-debug:latest   "/opt/bin/entry_point"   18 minutes ago      Up 18 minutes       0.0.0.0:9997->5900/tcp                  athena-selenium-0-chrome-debug-9997
 4139596b4825        selenium/node-chrome-debug:latest   "/opt/bin/entry_point"   19 minutes ago      Up 19 minutes       0.0.0.0:9996->5900/tcp                  athena-selenium-0-chrome-debug-9996
 6d792216b40e        selenium/hub:latest                 "/opt/bin/entry_point"   19 minutes ago      Up 19 minutes       4444/tcp                                athena-selenium-0-hub
 669fbd9b96df        olx/athena-proxy:0.3.1              "/opt/bootstrap/route"   19 minutes ago      Up 19 minutes       9091-9999/tcp, 0.0.0.0:1004->9090/tcp   athena-plugin-proxy-0-1004
 3e40a3bef672        olx/athena-proxy:0.3.1              "/opt/bootstrap/route"   19 minutes ago      Up 19 minutes       9091-9999/tcp, 0.0.0.0:1003->9090/tcp   athena-plugin-proxy-0-1003
 53c45b4a8264        olx/athena-proxy:0.3.1              "/opt/bootstrap/route"   19 minutes ago      Up 19 minutes       9091-9999/tcp, 0.0.0.0:1002->9090/tcp   athena-plugin-proxy-0-1002
 6ff1bc4ec70b        olx/athena-proxy:0.3.1              "/opt/bootstrap/route"   19 minutes ago      Up 19 minutes       9091-9999/tcp, 0.0.0.0:1001->9090/tcp   athena-plugin-proxy-0-1001

Then we do athena php bdd . athena.bdd.m.json --browser=chrome --config=behat-mobile.yml --parallel-process=4, here the result:

 PHP Fatal error:  Uncaught exception 'GuzzleHttp\Ring\Exception\ConnectException' with message 'cURL error 6: Could not resolve host: athena-proxy' in /opt/athena/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php:126
 Stack trace:
 #0 /opt/athena/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php(91): GuzzleHttp\Ring\Client\CurlFactory::createErrorResponse(Array, Array, Array)
 #1 /opt/athena/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php(96): GuzzleHttp\Ring\Client\CurlFactory::createResponse(Array, Array, Array, Array, Resource id #67)
 #2 /opt/athena/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php(68): GuzzleHttp\Ring\Client\CurlHandler->_invokeAsArray(Array)
 #3 /opt/athena/vendor/guzzlehttp/ringphp/src/Client/Middleware.php(54): GuzzleHttp\Ring\Client\CurlHandler->__invoke(Array)
 #4 /opt/athena/vendor/guzzlehttp/ringphp/src/Client/Middleware.php(30): GuzzleHttp\Ring\Client\Middleware::GuzzleHttp\Ring\Client\{closure}(Array)
 #5 /opt/athena/vendor/guzzlehttp/guzzle/src/RequestFsm.php(129): GuzzleHttp\Ring\Client\ in /opt/athena/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 49
 
                                                       
   [GuzzleHttp\Exception\ConnectException]             
   cURL error 6: Could not resolve host: athena-proxy  
                                                       
 
                                                       
   [GuzzleHttp\Ring\Exception\ConnectException]        
   cURL error 6: Could not resolve host: athena-proxy  
                                                       
 
 [ERROR] Behat exited with a non-zero code.
 
 Stacktrace:
         /opt/athena/bin/cmd/bdd.sh:75
         /opt/bootstrap/router.sh:28
@fergadipaolx fergadipaolx changed the title Cannot start php bdd with parallel process Cannot start php bdd with parallel process using 4 proxy containers Jan 12, 2017
@pproenca
Copy link
Contributor

pproenca commented Jan 23, 2017

Hello @fergadipaolx

After doing a few tests on our own, we've reached a few conclusions:

  • We can have a single proxy container which will be shared across all nodes and the container where the tests run in. This means it's possible to run parallel tests with a single proxy container but not with multiple.
  • The current version of the BrowserMob Proxy is actually throwing random null pointer exceptions when we run multiple tests at the same time

We've create a list of steps you can follow to have parallel tests running with a single proxy container:

  • echo 'PROXY_VERSION=2.1.4' > /tmp/proxy.env – use the latest version of BrowserMob proxy since it's one we managed to have parallel tests running in
  • athena proxy start --athena-env=/tmp/proxy.env – start the single proxy container
  • athena selenium start hub latest
  • athena selenium start firefox latest --instances=2 – this will start 2 firefox containers and link them automatically to the hub and proxy
  • Clone athena-oss/plugin-php repository
  • Go inside the directory where the repository is and do cd ./example-tests

Replace the contents of./Bdd/Features/AnonymousUserSearch.feature with the text below:
(continues below..)

Feature: Anonymous User performs a search

  As a Anonymous User
  I want to perform a search for a string
  So that I can get a list of results related with my search

  @parallel-scenario
  Scenario: Searched string returns results
    Given the current location is the home page
    When the Anonymous User writes "athena" in the search box
    And the Anonymous User performs a click in the search button
    Then the current location should be results page

  @parallel-scenario
  Scenario: Searched string returns results
    Given the current location is the home page
    When the Anonymous User writes "athena" in the search box
    And the Anonymous User performs a click in the search button
    Then the current location should be results page

  @parallel-scenario
  Scenario: Searched string returns results
    Given the current location is the home page
    When the Anonymous User writes "athena" in the search box
    And the Anonymous User performs a click in the search button
    Then the current location should be results page
  • athena php bdd . athena.json --parallel-process=2 --browser=firefox – this will start two scenarios in parallel and use the firefox browsers we started in the beginning

Let me know if this works.

@pproenca
Copy link
Contributor

@fergadipaolx ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants