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

Connection fails if tests are not allowed to complete #28

Open
andy-blum opened this issue Apr 13, 2023 · 3 comments
Open

Connection fails if tests are not allowed to complete #28

andy-blum opened this issue Apr 13, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@andy-blum
Copy link

I've been struggling to get Drupal Nightwatch tests running at all, but this appears to be a bug worth sharing:

If I start running tests, and ^C before they finish, the web container will never connect to the selenium-chrome container again until I ddev restart.

Copy/Pasted output for search-ability:

andy@drupal-tests-web:/var/www/html/core$ yarn test:nightwatch tests/Drupal/Nightwatch/Tests/exampleTest.js 
yarn run v1.22.19
$ node -r dotenv-safe/config ./node_modules/.bin/nightwatch --config ./tests/Drupal/Nightwatch/nightwatch.conf.js tests/Drupal/Nightwatch/Tests/exampleTest.js

[Tests/Example Test] Test Suite
──────────────────────────────────────────────────────────────
ℹ Connected to selenium-chrome on port 4444 (585ms).
  Using: chrome (101.0.4951.41) on LINUX.

  ℹ Loaded url http://web in 181ms

  Running Test page:
───────────────────────────────────────────────────────────────────────────────────────────────────
  ℹ Loaded url http://web/test-page in 263ms
  ✔ Element <body> was visible after 53 milliseconds.
  ✔ Testing if element <body> contains text 'Test page text' (59ms)

  ✨ PASSED. 2 assertions. (443ms)

  Running Page objects test page:
───────────────────────────────────────────────────────────────────────────────────────────────────
  ℹ Loaded url http://web/test-page in 142ms
  ✔ Element <body> was visible after 34 milliseconds.
  ✔ Testing if element <Element [name=@body]> contains text 'Test page text' (28ms)
  ✔ Ensuring no deprecation errors have been triggered (11ms)

  ✨ PASSED. 3 assertions. (292ms)
^C


andy@drupal-tests-web:/var/www/html/core$ yarn test:nightwatch tests/Drupal/Nightwatch/Tests/exampleTest.js 
yarn run v1.22.19
$ node -r dotenv-safe/config ./node_modules/.bin/nightwatch --config ./tests/Drupal/Nightwatch/nightwatch.conf.js tests/Drupal/Nightwatch/Tests/exampleTest.js

[Tests/Example Test] Test Suite
──────────────────────────────────────────────────────────────
⠹ Connecting to selenium-chrome on port 4444...
  Error
      POST http://selenium-chrome:4444 /wd/hub/session - ECONNRESET
Error: socket hang up
    at Socket.socketCloseListener (node:_http_client:467:25)
    at Socket.emit (node:events:525:35)
    at Socket.emit (node:domain:489:12)
⠧ Connecting to selenium-chrome on port 4444...
^C


andy@drupal-tests-web:/var/www/html/core$

I'll also leave a screenshot version in case people prefer reading with the color-coded outputs:

Screenshot 2023-04-13 at 1 37 49 PM

@andy-blum andy-blum changed the title Connection fails when if tests are not allowed to complete Connection fails if tests are not allowed to complete Apr 13, 2023
@andy-blum
Copy link
Author

ddev debug test output here

@star-szr
Copy link
Contributor

I'm seeing the same issue with other types of tests too (not just Nightwatch), and if you connect via noVNC you'll likely see the browser still sitting there waiting (or you may just see the desktop wallpaper if the browser crashed).

My knowledge and experience is not strong in this area but would adding a health check help? If I can find some time, I will look into that.

@weitzman
Copy link
Collaborator

If anyone finds out whats happenning here, I'm all ears.

@weitzman weitzman added the help wanted Extra attention is needed label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants