-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.14.0
Node.js Version
20.10.0
Mode
WDIO Testrunner
Which capabilities are you using?
{
browserName: 'chrome',
'wdio:enforceWebDriverClassic': true,
'goog:platformName': 'desktop',
'wdio:exclude': [
'./test/specs/**/*mobile*.js'
],
'goog:loggingPrefs': { browser: 'WARNING' },
'goog:chromeOptions': {
args: [
'--no-sandbox',
'--disable-dev-shm-usage',
'--window-position=1050,210',
'--window-size=1366,768',
...headlessCapability
],
},
}What happened?
It's not a bug per se, just an unnecessary operation from what i can tell.
What is your expected behavior?
The agent should be reused for the entire duration of the test, i am not sure i see the benefit for creating a new agent for each individual request, even if this operation costs ~0.3-0.5 ms, but this small extra time is 10% for lots of requests
How to reproduce the bug.
In order to get an idea of how much time this operation adds to each request, i wrote a performance test for 3 very common operations: fetch element, click element and is element displayed.
Clone the issue highlight repo below, and run the same performance test for the original wdio, and patched wdio:
ENABLE_HEADLESS=1 DEBUG= yarn test --spec test/specs/suite1/validatePerformance.desktop.test.js
Original wdio 9.14.0 branch: dragosMC91/wdio-exclude-pattern-bug-highlight#11
Patched wdio 9.14.0 branch: dragosMC91/wdio-exclude-pattern-bug-highlight#10 (this just adds a cached dispatcher to the FetchRequest class)
Baseline wdio 8.44.1 branch: dragosMC91/wdio-exclude-pattern-bug-highlight#8
after checking out each branch, don't forget to yarn install to make sure you have the applied patch
Relevant log output
Here are the results for the performance test i ran on an M2 Pro machine (the median is the most relevant item):
### Wdio 9.14.0 original
--- Performance Test ---
Starting warm-up phase...
Warm-up complete. Starting measurement phase...
Selector: #testButton find test
Test Iterations: 1000
Measurement complete.
--- Request Timings Results (1000 samples) ---
P50: 3.414 ms (Median)
P75: 3.588 ms
P90: 4.096 ms
P95: 4.301 ms
IQR: 0.267 ms
StdDev: 0.394 ms
Min: 3.097 ms
Max: 6.691 ms
------------------------------------
Selector: #testButton click test
Test Iterations: 1000
Measurement complete.
--- Request Timings Results (1000 samples) ---
P50: 15.802 ms (Median)
P75: 16.084 ms
P90: 16.477 ms
P95: 16.763 ms
IQR: 0.462 ms
StdDev: 1.273 ms
Min: 14.677 ms
Max: 52.523 ms
------------------------------------
Selector: #testButton isDisplayed test
Test Iterations: 1000
Measurement complete.
--- Request Timings Results (1000 samples) ---
P50: 3.955 ms (Median)
P75: 4.082 ms
P90: 4.312 ms
P95: 4.558 ms
IQR: 0.229 ms
StdDev: 0.318 ms
Min: 3.398 ms
Max: 6.359 ms
------------------------------------
### Wdio 9.14.0 patched
--- Performance Test ---
Starting warm-up phase...
Warm-up complete. Starting measurement phase...
Selector: #testButton find test
Test Iterations: 1000
Measurement complete.
--- Request Timings Results (1000 samples) ---
P50: 3.121 ms (Median)
P75: 3.243 ms
P90: 3.410 ms
P95: 3.554 ms
IQR: 0.209 ms
StdDev: 0.247 ms
Min: 2.800 ms
Max: 6.134 ms
------------------------------------
Selector: #testButton click test
Test Iterations: 1000
Measurement complete.
--- Request Timings Results (1000 samples) ---
P50: 15.329 ms (Median)
P75: 15.992 ms
P90: 16.970 ms
P95: 17.218 ms
IQR: 0.861 ms
StdDev: 0.825 ms
Min: 13.535 ms
Max: 23.268 ms
------------------------------------
Selector: #testButton isDisplayed test
Test Iterations: 1000
Measurement complete.
--- Request Timings Results (1000 samples) ---
P50: 3.341 ms (Median)
P75: 3.444 ms
P90: 3.569 ms
P95: 3.667 ms
IQR: 0.163 ms
StdDev: 0.304 ms
Min: 2.837 ms
Max: 9.907 ms
------------------------------------
### (Optional for reference) Wdio 8.44.1
--- Performance Test ---
Starting warm-up phase...
Warm-up complete. Starting measurement phase...
Selector: #testButton find test
Test Iterations: 1000
Measurement complete.
--- Request Timings Results (1000 samples) ---
P50: 3.083 ms (Median)
P75: 3.213 ms
P90: 3.491 ms
P95: 3.602 ms
IQR: 0.235 ms
StdDev: 0.249 ms
Min: 2.745 ms
Max: 5.071 ms
------------------------------------
Selector: #testButton click test
Test Iterations: 1000
Measurement complete.
--- Request Timings Results (1000 samples) ---
P50: 15.225 ms (Median)
P75: 15.609 ms
P90: 16.091 ms
P95: 16.485 ms
IQR: 0.603 ms
StdDev: 0.825 ms
Min: 12.290 ms
Max: 22.453 ms
------------------------------------
Selector: #testButton isDisplayed test
Test Iterations: 1000
Measurement complete.
--- Request Timings Results (1000 samples) ---
P50: 1.659 ms (Median)
P75: 1.726 ms
P90: 1.811 ms
P95: 1.885 ms
IQR: 0.110 ms
StdDev: 0.125 ms
Min: 1.459 ms
Max: 3.016 ms
------------------------------------Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues