From 081e874270fc0b63fbc59dcc013743db1da97585 Mon Sep 17 00:00:00 2001 From: Howard Edwards Date: Tue, 25 Jul 2023 16:10:09 -0400 Subject: [PATCH] Infrastructure: Change localhost references to accommodate Node V17 (#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. --- .github/workflows/regression.yml | 1 - test/index.js | 2 +- test/util/start-geckodriver.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index d0cfffa8df..7ea03368f5 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -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 diff --git a/test/index.js b/test/index.js index d9641c9153..f8754063c3 100644 --- a/test/index.js +++ b/test/index.js @@ -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, diff --git a/test/util/start-geckodriver.js b/test/util/start-geckodriver.js index 110a771400..01d6a25608 100644 --- a/test/util/start-geckodriver.js +++ b/test/util/start-geckodriver.js @@ -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);