chilio / laravel-dusk-ci

Docker Test suite for Laravel Dusk in gitlab CI
MIT License
160 stars 51 forks source link

not connected to DevTools #34

Closed msonowal closed 6 years ago

msonowal commented 6 years ago

Hi @chilio , Thanks for your great work, I am using your image since a month I am setting it up with a gitlab ci yml file. But I keep getting the error [WARNING]: Unable to evaluate script: disconnected: not connected to DevTools after the 3rd or 4th tests and sometime it comes Facebook\WebDriver\Exception\UnrecognizedExceptionException: chrome not reachable or Facebook\WebDriver\Exception\NoSuchDriverException: invalid session id

Any idea what can it cause I am having hard time trying but it does not work

Below is the log


System Chrome version: 70
System Chromedriver version: 2.43
Laravel Chromedriver version: 2.35
Chromedriver shipped with your Laravel installation is NOT compatible with this systems chrome version!
Don't worry, we are fixing this right now, so you will be able, to test your app anyway.
You can always read more about running tests with system inbuilt chromedriver in laravel-dusk-ci docs.
Scheduled start of inbuilt Chromedriver (2.43). Chromedriver will be ready soon...
$ start-nginx-ci-project
Starting ChromeDriver 2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d) on port 9515
Only local connections are allowed.
[1540405389.987][SEVERE]: bind() returned an error, errno=0: Cannot assign requested address (99)
 * Starting nginx nginx
   ...done.
$ php artisan dusk --colors --debug
Warning: TTY mode requires /dev/tty to be read/writable.
PHPUnit 6.5.13 by Sebastian Bergmann and contributors.

Test 'Tests\Browser\AdminLoginTest::testInvalidLogin' started
Test 'Tests\Browser\AdminLoginTest::testInvalidLogin' ended
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_working' started
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_working' ended
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_edit_modal_working' started
[1540405436.988][WARNING]: Unable to evaluate script: disconnected: not connected to DevTools
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_edit_modal_working' ended
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_language_modal_working' started
[1540405437.036][WARNING]: Unable to evaluate script: disconnected: not connected to DevTools
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_language_modal_working' ended
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_health_modal_working' started
[1540405437.080][WARNING]: Unable to evaluate script: disconnected: not connected to DevTools
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_health_modal_working' ended
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_allergy_modal_working' started
[1540405437.128][WARNING]: Unable to evaluate script: disconnected: not connected to DevTools
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_allergy_modal_working' ended
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_medical_history_working' started
[1540405437.175][WARNING]: Unable to evaluate script: disconnected: not connected to DevTools
Test 'Tests\Browser\ProfileComponentTest::test_profile_page_medical_history_working' ended
Test 'Tests\Browser\ProfileComponentTest::test_can_add_medication' started
Test 'Tests\Browser\ProfileComponentTest::test_can_add_medication' ended
Test 'Tests\Browser\UserRegistrationLoginTest::testLoginPage' started
Test 'Tests\Browser\UserRegistrationLoginTest::testLoginPage' ended
Test 'Tests\Browser\UserRegistrationLoginTest::testUserCanRegister' started
Test 'Tests\Browser\UserRegistrationLoginTest::testUserCanRegister' ended

Time: 1.36 minutes, Memory: 32.00MB

There were 6 errors:

1) Tests\Browser\ProfileComponentTest::test_profile_page_edit_modal_working
Facebook\WebDriver\Exception\UnrecognizedExceptionException: chrome not reachable
  (Session info: headless chrome=70.0.3538.67)
  (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.4.0-1069-aws x86_64)

/builds/titans/project/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:158
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:326
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:547
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:345
/builds/titans/project/vendor/laravel/dusk/src/Browser.php:244
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:135
/builds/titans/project/vendor/laravel/framework/src/Illuminate/Support/Collection.php:339
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:136
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:69
/builds/titans/project/tests/Browser/ProfileComponentTest.php:55

2) Tests\Browser\ProfileComponentTest::test_profile_page_language_modal_working
Facebook\WebDriver\Exception\UnrecognizedExceptionException: chrome not reachable
  (Session info: headless chrome=70.0.3538.67)
  (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.4.0-1069-aws x86_64)

/builds/titans/project/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:158
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:326
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:547
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:345
/builds/titans/project/vendor/laravel/dusk/src/Browser.php:244
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:135
/builds/titans/project/vendor/laravel/framework/src/Illuminate/Support/Collection.php:339
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:136
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:69
/builds/titans/project/tests/Browser/ProfileComponentTest.php:66

3) Tests\Browser\ProfileComponentTest::test_profile_page_health_modal_working
Facebook\WebDriver\Exception\UnrecognizedExceptionException: chrome not reachable
  (Session info: headless chrome=70.0.3538.67)
  (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.4.0-1069-aws x86_64)

/builds/titans/project/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:158
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:326
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:547
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:345
/builds/titans/project/vendor/laravel/dusk/src/Browser.php:244
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:135
/builds/titans/project/vendor/laravel/framework/src/Illuminate/Support/Collection.php:339
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:136
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:69
/builds/titans/project/tests/Browser/ProfileComponentTest.php:77

4) Tests\Browser\ProfileComponentTest::test_profile_page_allergy_modal_working
Facebook\WebDriver\Exception\UnrecognizedExceptionException: chrome not reachable
  (Session info: headless chrome=70.0.3538.67)
  (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.4.0-1069-aws x86_64)

/builds/titans/project/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:158
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:326
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:547
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:345
/builds/titans/project/vendor/laravel/dusk/src/Browser.php:244
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:135
/builds/titans/project/vendor/laravel/framework/src/Illuminate/Support/Collection.php:339
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:136
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:69
/builds/titans/project/tests/Browser/ProfileComponentTest.php:88

5) Tests\Browser\ProfileComponentTest::test_profile_page_medical_history_working
Facebook\WebDriver\Exception\UnrecognizedExceptionException: chrome not reachable
  (Session info: headless chrome=70.0.3538.67)
  (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.4.0-1069-aws x86_64)

/builds/titans/project/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:158
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:326
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:547
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:345
/builds/titans/project/vendor/laravel/dusk/src/Browser.php:244
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:135
/builds/titans/project/vendor/laravel/framework/src/Illuminate/Support/Collection.php:339
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:136
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:69
/builds/titans/project/tests/Browser/ProfileComponentTest.php:99

6) Tests\Browser\UserRegistrationLoginTest::testUserCanRegister
Facebook\WebDriver\Exception\NoSuchDriverException: invalid session id
  (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.4.0-1069-aws x86_64)

/builds/titans/project/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:100
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:326
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:547
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteExecuteMethod.php:40
/builds/titans/project/vendor/facebook/webdriver/lib/WebDriverOptions.php:156
/builds/titans/project/vendor/laravel/dusk/src/Browser.php:259
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:148
/builds/titans/project/vendor/laravel/framework/src/Illuminate/Support/Collection.php:339
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:149
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:77
/builds/titans/project/tests/Browser/UserRegistrationLoginTest.php:69
/builds/titans/project/tests/Browser/UserRegistrationLoginTest.php:57

Caused by
Facebook\WebDriver\Exception\NoSuchDriverException: invalid session id
  (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.4.0-1069-aws x86_64)

/builds/titans/project/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:100
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:326
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:547
/builds/titans/project/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:345
/builds/titans/project/vendor/laravel/dusk/src/Browser.php:244
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:135
/builds/titans/project/vendor/laravel/framework/src/Illuminate/Support/Collection.php:339
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:136
/builds/titans/project/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:69
/builds/titans/project/tests/Browser/UserRegistrationLoginTest.php:69
/builds/titans/project/tests/Browser/UserRegistrationLoginTest.php:57

--```
chilio commented 6 years ago

Can you check this thread for the beginnng?

msonowal commented 6 years ago

@chilio I have checked and tried every possible no luck maybe resolution resize can cause this?

chilio commented 6 years ago

@msonowal I doubt resize could cause this (you can always verify it yourself), rather I would suspect infrastructure or too complex tests. I have a few additional questions for your case:

  1. Can you find any significant common block in your modal tests, which might break tests, cause from your log it seems to happen on modals mostly? If tests are failing randomly, please omit this question.
  2. Are you sure, that all tests are passing green on your local dev environment?
  3. What are the parameters of your machine on AWS (CPU, MEM, Storage definitions)?

BTW. A small note from my experiences, if memory usage goes beyond default and system needs to use swap then these nasty problems are coming into force, certain lags, timeouts, etc. This sounds strange cause you should not experience them in services like AWS, or am I misssing something.

chilio commented 6 years ago

@msonowal Additional note I have seen same tests randomly failing while using certain jquery plugins like for example iCheck. Removing these plugins made my stressed out, concurrent gitlab-runners going green. So please keep in mind, that your project may be responsible for any strange behavior also...

msonowal commented 6 years ago

@chilio There is no jQuery involved only pure Vue right now it is working green after I have removed all the resize methods and put the window size in the start. It is working

chilio commented 6 years ago

@msonowal great to hear that. I hope Laravel Dusk becomes more robust with time...