-
-
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.12.1
Node.js Version
22.14.0
Mode
WDIO Testrunner
What happened?
Since upgrading to WebdriverIO v9.12.1, when running a test that relies on a Selenoid instance running in Docker, I get the following error :
[0-0] node:internal/dns/promises:99
[0-0] this.reject(new DNSException(err, 'getaddrinfo', this.hostname));
[0-0] ^
[0-0]
[0-0] Error: getaddrinfo EAI_AGAIN 8f3a4490710c
[0-0] at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:internal/dns/promises:99:17) {
[0-0] errno: -3001,
[0-0] code: 'EAI_AGAIN',
[0-0] syscall: 'getaddrinfo',
[0-0] hostname: '8f3a4490710c'
[0-0] }
This seems to be a regression introduced with #14259, more precisely by these lines.
I assume that WebdriverIO tries to resolve the browser container's hostname (8f3a4490710c) to an IP address but since that hostname is only known inside the Docker network, the resolution crashes. Before that change, WebdriverIO would have fallen back to the classic Webdriver protocol.
What is your expected behavior?
I expect WebdriverIO to ignore such errors, fallback to the classic Webdriver protocol, and run the test like it used to.
How to reproduce the bug.
To reproduce the bug, all you have to do is run a test that relies on a Selenoid instance running in Docker. To make this easier, I've created a minimal reproducible example that you can find here, with all the instructions needed.
Relevant log output
[0-0] INFO webdriver: Connecting to webSocketUrl ws://8f3a4490710c:4444/session/a8968f21d3d37460598ee9f1e2f4af7f
[0-0] node:internal/dns/promises:99
[0-0] this.reject(new DNSException(err, 'getaddrinfo', this.hostname));
[0-0] ^
[0-0]
[0-0] Error: getaddrinfo EAI_AGAIN 8f3a4490710c
[0-0] at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:internal/dns/promises:99:17) {
[0-0] errno: -3001,
[0-0] code: 'EAI_AGAIN',
[0-0] syscall: 'getaddrinfo',
[0-0] hostname: '8f3a4490710c'
[0-0] }
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