Protractor + Firefox + docker: 无效参数:无法终止退出的进程

Protractor + Firefox + docker: invalid argument: can't kill an exited process

我曾经工作过,但一周后,我的 angular E2E 测试无法在 docker 中 运行 开始。如果我直接 运行 它们仍然可以正常工作。

protractor.conf.js

exports.config = {
  capabilities: {
    browserName: 'firefox',
    'moz:firefoxOptions': {
      args: [
        '--headless'
      ]
    }
  }
  directConnect: true,
  baseUrl: 'http://localhost:4200',
  framework: 'jasmine',
  ...
}

如果我启动 webdriver:webdriver-manager start

然后是量角器:protractor protractor.conf.js

输出:

I/launcher - Running 1 instances of WebDriver
I/direct - Using FirefoxDriver directly...
E/launcher - invalid argument: can't kill an exited process
E/launcher - WebDriverError: invalid argument: can't kill an exited process
    at Object.throwDecodedError (/tmp/e2e-test/node_modules/selenium-webdriver/lib/error.js:514:15)
    at parseHttpResponse (/tmp/e2e-test/node_modules/selenium-webdriver/lib/http.js:519:13)
    at doSend.then.response (/tmp/e2e-test/node_modules/selenium-webdriver/lib/http.js:441:30)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: WebDriver.createSession()
    at Function.createSession (/tmp/e2e-test/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
    at Function.createSession (/tmp/e2e-test/node_modules/selenium-webdriver/firefox/index.js:521:41)
    at Direct.getNewDriver (/tmp/e2e-test/node_modules/protractor/built/driverProviders/direct.js:105:33)
    at Runner.createBrowser (/tmp/e2e-test/node_modules/protractor/built/runner.js:195:43)
    at q.then.then (/tmp/e2e-test/node_modules/protractor/built/runner.js:339:29)
    at _fulfilled (/tmp/e2e-test/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/tmp/e2e-test/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/tmp/e2e-test/node_modules/q/q.js:796:13)
    at /tmp/e2e-test/node_modules/q/q.js:556:49
    at runSingle (/tmp/e2e-test/node_modules/q/q.js:137:13)
E/launcher - Process exited with error code 199

我已经在 Firefox 62.0 和 60.0.2 上进行了尝试,没有进行任何更改。

追查各个软件的新版本,终于发现gecko-driver已经在4天前收到了一个new v0.22.0 release,好像坏了protractor/selenium。

现在,我将强制使用 geckodriver v0.21.0,它运行良好:

webdriver-manager update  --versions.gecko=v0.21.0

对我来说,running Firefox in headless mode 解决了这个问题。