-
-
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
8.39.1
Node.js Version
20.15.1
Mode
Standalone Mode
Which capabilities are you using?
No response
What happened?
We noticed OOM errors in our CI runners after introducing rigorous a11y tests using @axe-core/webdriverio (rigorous meaning: running Axe whenever the UI changes). In dequelabs/axe-core-npm#1086 I've traced this down to this happening:
- On every AxeBuilder::analyze call, @axe-core/webdriverio uses
execute/executeAsyncto execute (rather large) script(s). (the main axe-core script is 1.2 MiB) - WebdriverIO internally executes a protocol command, which emits, among other data, the "body" (script) here.
- That object is then emitted to the configured reporters here.
- And persisted in the TestStats here.
(note the links are all to recent commits on main (v9), but IIRC code flow is essentially identical in v8)
What is your expected behavior?
I don't know why every single execute / executeAsync script execution needs to be persisted in the "TestStats". If that is not necessary, it should be removed. Alternatively, we could:
- Provide an option for
executeandexecuteAsyncto opt out of this behavior, or - Only persist the first X bytes of the script (maybe 1KB?), to reduce the impact, or
- Somehow make sure that duplicate scripts in the TestStats all refer to the same in-memory string,
- ... ?
Happy to hear any other options/ideas. In the mean time, if there's a anything which let's us clean up these TestStats during the run, so that our CI doesn't OOM, I would appreciate any pointers.
How to reproduce the bug.
Follow the instructions in https://github.com/johannespfrang/axe-wdio-memory-leak.
Relevant log output
Nothing relevant.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