Reduce wait port retry interval#14311
Conversation
eslint-plugin-wdio
@wdio/allure-reporter
@wdio/browser-runner
@wdio/browserstack-service
@wdio/appium-service
@wdio/cli
@wdio/concise-reporter
@wdio/config
@wdio/cucumber-framework
@wdio/dot-reporter
@wdio/firefox-profile-service
@wdio/globals
@wdio/jasmine-framework
@wdio/json-reporter
@wdio/junit-reporter
@wdio/lighthouse-service
@wdio/local-runner
@wdio/logger
@wdio/mocha-framework
@wdio/protocols
@wdio/repl
@wdio/reporter
@wdio/runner
@wdio/sauce-service
@wdio/shared-store-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/spec-reporter
@wdio/static-server-service
@wdio/sumologic-reporter
@wdio/testingbot-service
@wdio/types
@wdio/utils
@wdio/webdriver-mock-service
webdriver
webdriverio
commit: |
| } | ||
|
|
||
| await waitPort({ port, output: 'silent', timeout: DRIVER_WAIT_TIMEOUT }) | ||
| await waitPort({ port, output: 'silent', timeout: DRIVER_WAIT_TIMEOUT, interval: DRIVER_RETRY_INTERVAL }) |
There was a problem hiding this comment.
I don't see an interval option in the documentation of the package
christian-bromann
left a comment
There was a problem hiding this comment.
Good catch 👌
@erwinheitzman I found the parameter in the code:
/** The number of milliseconds to wait on each connection attempt
* (defaults to 1000) */
interval?: number;
|
Hey dragosMC91 👋 Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. We are looking forward to more contributions from you in the future 🙌 Have a nice day, |
Proposed changes
This is a patch for #14310
I am currently trying to upgrade to wdio 9 from 8 but it's 10-20% slower.
If we reduce the wait connection retry interval, which is currently set to default (1000ms), the execution will continue much faster.
The 1 sec retry is excessive because the driver process spawn time is ~10ms
and the time before the port is open and ready to use is another ~10ms
Ironically, this delay is more visible on wdio 9 than it is on wdio 8 because the execution time between
driver process spawn -> waitPortis actually smaller than it is on wdio 8, and during the 1st iteration ofwaitPort, the port is not available, so it waits the default 1 sec.The tweak presented here is one of the factors which cause the slower overall test execution time.
Types of changes
Checklist
Backport Request
//: # (The current
mainbranch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against thev8branch.)v9and doesn't need to be back-ported#XXXXXFurther comments
Reviewers: @webdriverio/project-committers