Skip to content

Connection fails if tests are not allowed to complete #28

@andy-blum

Description

@andy-blum

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions