nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.8k stars 1.31k forks source link

Stale geckodriver/chromedriver processes #1904

Closed eiva closed 5 years ago

eiva commented 5 years ago

Each time e2e test suite run geckodriver/chromedrive remain in process list:

> pstree
...
node─┬─geckodriver───42*[{geckodriver}]
     └─6*[{node}]
...

Versions:

"nightwatch": "^0.9.21",
"chromedriver": "^2.42.0",
"selenium-server": "^3.14.0",
"geckodriver": "^1.12.2",
"selenium": "^2.20.0",

Mozilla Firefox 60.2.1

Cofiguration

Almost default generated by vue-init webpack with added fix for headless firefox.

require('babel-register')
var config = require('../../config')

// http://nightwatchjs.org/gettingstarted#settings-file
module.exports = {
  src_folders: ['test/e2e/specs'],
  output_folder: 'test/e2e/reports',
  custom_assertions_path: ['test/e2e/custom-assertions'],

  selenium: {
    start_process: true,
    server_path: require('selenium-server').path,
    host: '127.0.0.1',
    port: 4444,
    cli_args: {
      'webdriver.chrome.driver': require('chromedriver').path,
      'webdriver.firefox.driver': require('geckodriver').path
    }
  },

  test_settings: {
    default: {
      start_process: true,
      selenium_port: 4444,
      selenium_host: 'localhost',
      silent: true,
      globals: {
        devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
      }
    },

    chrome: {
      desiredCapabilities: {
        browserName: 'chrome',
        javascriptEnabled: true,
        chromeOptions: {
          "args" : ["--no-sandbox", "--headless", "--disable-dev-shm-usage"]
        },
        acceptSslCerts: true,
        noSandbox: true,
        disableDevShmUsage: true,
      }
    },

    firefox: {
      desiredCapabilities: {
        browserName: 'firefox',
        javascriptEnabled: true,
        acceptSslCerts: true,
        'moz:firefoxOptions': {
          args: ['-headless', '-no-sandbox']
        }
      }
    }
  }
}

Effect

As result after some time of such runs CI agent or user run out of thread limit and failed to work.

beatfactor commented 5 years ago

Can you please retest against the latest released version - v1.0.12? Thanks.

segl84 commented 5 years ago

Got the same problem and it's still alive in v1.0.12.

beatfactor commented 5 years ago

which OS?

beatfactor commented 5 years ago

@segl84 if you're experiencing the same issue please indicate your environment settings.

segl84 commented 5 years ago

System

Windows 10 64 Bit

Nightwatch Configuration

{
   "src_folders": [ "tests" ],
   "output_folder": false,
   "custom_commands_path": "commands",
   "custom_assertions_path": "",
   "page_objects_path": "",
   "globals_path": "globals.js",
   "selenium": {
      "start_process": true,
      "server_path": "selenium/selenium-server-standalone-3.141.0.jar",
      "log_path": "",
      "port": 4444,
      "cli_args": {
         "webdriver.chrome.driver": "W3CWebDriver/chrome/chromedriver.exe",
         "webdriver.gecko.driver": "W3CWebDriver/firefox/geckodriver.exe"
      }
   },
   "test_settings": {
      "default": {
         "launch_url": "http://localhost",
         "selenium_port": 4444,
         "selenium_host": "127.0.0.1",
         "silent": true,
         "screenshots": {
            "enabled": false,
            "path": ""
         }
      },
      "chrome": {
         "desiredCapabilities": {
            "browserName": "chrome",
            "marionette": true
         }
      },
      "firefox": {
         "desiredCapabilities": {
            "browserName": "firefox",
            "marionette": true
         }
      }
   }
}

package.json

   "devDependencies": {
      "current-processes": "0.2.x",
      "parent-process-pid": "1.0.x",
      "nightwatch": "1.0.x"
   }

Do you need more information?

beatfactor commented 5 years ago

@segl84 yeah, a sample test would be useful.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had any recent activity. If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contribution.