Skip to content

[JS] handle a breaking changes in os.networkInterfaces#10611

Merged
diemol merged 2 commits intoSeleniumHQ:trunkfrom
outsideris:node-fix-network-family
May 5, 2022
Merged

[JS] handle a breaking changes in os.networkInterfaces#10611
diemol merged 2 commits intoSeleniumHQ:trunkfrom
outsideris:node-fix-network-family

Conversation

@outsideris
Copy link
Copy Markdown
Contributor

Description

Until Node 16, os.networkInterfaces()'s family is either IPv4 or IPv6.

{
  address: '127.0.0.1',
  netmask: '255.0.0.0',
  family: 'IPv4',
  mac: '00:00:00:00:00:00',
  internal: true,
  cidr: '127.0.0.1/8'
},

However, in Node 18, os.networkInterfaces()'s family is either 4(for IPv4) or 6(for IPv6).

{
  address: '127.0.0.1',
  netmask: '255.0.0.0',
  family: 4,
  mac: '00:00:00:00:00:00',
  internal: true,
  cidr: '127.0.0.1/8'
},

So, this patch can handle both IPv4/IPv6 and 4/6.

Motivation and Context

When I run tests for my project with Node 18, I failed because selenium-webdriver can't get any network interfaces.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

In Node 18+, os.networkInterface's family is either 4 or 6,
os.networkInterface's family was either IPv4 or IPv6 until Node 16

Signed-off-by: Outsider <[email protected]>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 5, 2022

CLA assistant check
All committers have signed the CLA.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Copy Markdown
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @outsideris!

@diemol diemol merged commit dec3bb8 into SeleniumHQ:trunk May 5, 2022
elgatov pushed a commit to elgatov/selenium that referenced this pull request Jun 27, 2022
)

In Node 18+, os.networkInterface's family is either 4 or 6,
os.networkInterface's family was either IPv4 or IPv6 until Node 16

Signed-off-by: Outsider <[email protected]>

Co-authored-by: Diego Molina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants