selenium-standalone icon indicating copy to clipboard operation
selenium-standalone copied to clipboard

The `onCancel` handler was attached after the promise settled thrown on start

Open PkAIR opened this issue 2 years ago • 0 comments

Expected Behavior

Browsers can be started on the first try

Current Behavior

Error thrown on start

/.../node_modules/p-cancelable/index.js:48
					throw new Error('The `onCancel` handler was attached after the promise settled.');
					      ^
Error: The `onCancel` handler was attached after the promise settled.
    at onCancel (/.../node_modules/p-cancelable/index.js:48:12)
    at makeRequest (/.../node_modules/got/dist/source/as-promise/index.js:38:13)
    at Request.<anonymous> (/.../node_modules/got/dist/source/as-promise/index.js:143:17)
    at Object.onceWrapper (node:events:642:26)
    at Request.emit (node:events:527:28)
    at Timeout.retry (/.../node_modules/got/dist/source/core/index.js:1264:30)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)
Node.js v18.0.0

Steps to Reproduce

Step is quite simple - start any test in my case using gradle

tasks.register("npmInstall") {
    def execOps = services.get(ExecOperations)
    doLast {
        execOps.exec {
            commandLine npm, 'install'
        }
        execOps.exec {
            commandLine seleniumBin, 'install', '--config=./webdriverConfig.js'
        }
    }
}

tasks.register("startWebDriver", SpawnProcessTaskPatched) {
    command "$seleniumBin start --config=./webdriverConfig.js"
    ready 'Selenium started'
    directory projectDir.path
}

webdriverConfig.js

module.exports = {
    version: '4.1.3',
    drivers: {
        chrome: {
            version: 'latest',
            fallbackVersion: '99.0.4844.51',
        },
        firefox: {
            version: 'latest',
            fallbackVersion: '0.30.0',
        },
    },
    ignoreExtraDrivers: true,
}

Your Environment

  • Version of selenium-standalone: 8.1.2
  • Is there another tool calling selenium-standalone on your behalf: Gradle
  • System/platform: MacOS
  • Other details that might be important: Noticed version for p-cancelable is ^2.0.0 when the latest version is 4.0.0

PkAIR avatar May 04 '22 12:05 PkAIR