Skip to content

Commit

Permalink
Infrastructure: Change localhost references to accommodate Node V17 (#…
Browse files Browse the repository at this point in the history
…2749)

Regression tests failed to run with Node V17, so we temporarily pinned the version to 16. This is an alternative fix that enables running with node V17+.

This commit unpins the node version and replaces references to localhost with 127.0.0.1.

Node v17+ deprioritised IPv4 addresses in favour of IPv6 with a change to dns.setDefaultResultOrder.
Node made this change without a happy-eyeballs implementation, which meant the loopback address used when running the regression tests resolved to ::1 rather than the IPv4 loopback (127.0.0.1) -- the address geckodriver expected.
So this PR now explicitly uses 127.0.0.1.
Alternatively, we could have added --dns-result-order=ipv4first to the running script, or added dns.setDefaultResultOrder('ipv4first');, but would eventually remove it as the happy-eyeballs implementation is now included in v20.
  • Loading branch information
howard-e committed Jul 25, 2023
1 parent d6cf9d8 commit 081e874
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm

- name: Install npm dependencies
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (!coverageReportRun) {
test.before(async () => {
geckodriver = await startGeckodriver(1022, 12 * 1000);
session = new webdriver.Builder()
.usingServer('http://localhost:' + geckodriver.port)
.usingServer('http://127.0.0.1:' + geckodriver.port)
.withCapabilities({
'moz:firefoxOptions': {
args: firefoxArgs,
Expand Down
2 changes: 1 addition & 1 deletion test/util/start-geckodriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const startOnPort = (port, timeout) => {
return;
}

getJSON('http://localhost:' + port + '/status')
getJSON('http://127.0.0.1:' + port + '/status')
.then((data) => {
assert(data.value.ready);

Expand Down

0 comments on commit 081e874

Please sign in to comment.