From c7956312a5e8534b7493500f078cad0fba8ffeda Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Tue, 23 May 2023 07:19:46 +0200 Subject: [PATCH 1/3] ci: Remove v14 from the test matrix and add v20 --- .github/workflows/build.yml | 2 +- .github/workflows/deploy.yml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74fa65ae347..8b1a1a12928 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x, 16.x, 18.x] + node-version: [16.x, 18.x, 20.x] steps: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f71a7c770de..6829ed49761 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,8 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - # node-version: [14.x, 16.x, 18.x] - node-version: [16.x, 18.x] + node-version: [16.x, 18.x, 20.x] os: [ubuntu-latest, windows-latest, macos-latest] steps: - name: Use Node.js ${{ matrix.node-version }} From 0a11162dba5d5df14e76ce572177e03ff36a2b47 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Tue, 23 May 2023 10:06:01 +0200 Subject: [PATCH 2/3] Disable the failing test --- packages/driver-test-support/lib/e2e-suite.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/driver-test-support/lib/e2e-suite.js b/packages/driver-test-support/lib/e2e-suite.js index fcbb65ddf80..58530605867 100644 --- a/packages/driver-test-support/lib/e2e-suite.js +++ b/packages/driver-test-support/lib/e2e-suite.js @@ -1,5 +1,6 @@ import _ from 'lodash'; import {server, routeConfiguringFunction, DeviceSettings} from 'appium/driver'; +import { util } from 'appium/support'; import axios from 'axios'; import B from 'bluebird'; import {TEST_HOST, getTestPort, createAppiumURL} from './helpers'; @@ -148,6 +149,11 @@ export function driverE2ETestSuite(DriverClass, defaultCaps = {}) { describe('session handling', function () { it('should handle idempotency while creating sessions', async function () { + if (util.compareVersions(process.version, '>=', '19.0.0')) { + // FIXME: Unfortunately the 'socket hang up' error is too hard to debug + return this.skip(); + } + const sessionIds = []; let times = 0; do { @@ -159,11 +165,6 @@ export function driverE2ETestSuite(DriverClass, defaultCaps = {}) { headers: { 'X-Idempotency-Key': '123456', }, - // XXX: I'm not sure what these are, as they are not documented axios options, - // nor are they mentioned in our source - // @ts-expect-error - simple: false, - resolveWithFullResponse: true, } ); @@ -178,6 +179,11 @@ export function driverE2ETestSuite(DriverClass, defaultCaps = {}) { }); it('should handle idempotency while creating parallel sessions', async function () { + if (util.compareVersions(process.version, '>=', '19.0.0')) { + // FIXME: Unfortunately the 'socket hang up' error is too hard to debug + return this.skip(); + } + const reqs = []; let times = 0; do { From cf33303cc4ed1b04956a272ba1d8cb8787133f28 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Thu, 25 May 2023 07:46:36 +0200 Subject: [PATCH 3/3] Update tests --- packages/driver-test-support/lib/e2e-suite.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/driver-test-support/lib/e2e-suite.js b/packages/driver-test-support/lib/e2e-suite.js index 58530605867..9dcf4a282ea 100644 --- a/packages/driver-test-support/lib/e2e-suite.js +++ b/packages/driver-test-support/lib/e2e-suite.js @@ -1,11 +1,11 @@ import _ from 'lodash'; import {server, routeConfiguringFunction, DeviceSettings} from 'appium/driver'; -import { util } from 'appium/support'; import axios from 'axios'; import B from 'bluebird'; import {TEST_HOST, getTestPort, createAppiumURL} from './helpers'; import chai from 'chai'; import sinon from 'sinon'; +import { Agent } from 'node:http'; const should = chai.should(); @@ -149,10 +149,8 @@ export function driverE2ETestSuite(DriverClass, defaultCaps = {}) { describe('session handling', function () { it('should handle idempotency while creating sessions', async function () { - if (util.compareVersions(process.version, '>=', '19.0.0')) { - // FIXME: Unfortunately the 'socket hang up' error is too hard to debug - return this.skip(); - } + // workaround for https://github.com/node-fetch/node-fetch/issues/1735 + const httpAgent = new Agent({ keepAlive: true }); const sessionIds = []; let times = 0; @@ -165,6 +163,7 @@ export function driverE2ETestSuite(DriverClass, defaultCaps = {}) { headers: { 'X-Idempotency-Key': '123456', }, + httpAgent, } ); @@ -179,10 +178,8 @@ export function driverE2ETestSuite(DriverClass, defaultCaps = {}) { }); it('should handle idempotency while creating parallel sessions', async function () { - if (util.compareVersions(process.version, '>=', '19.0.0')) { - // FIXME: Unfortunately the 'socket hang up' error is too hard to debug - return this.skip(); - } + // workaround for https://github.com/node-fetch/node-fetch/issues/1735 + const httpAgent = new Agent({ keepAlive: true }); const reqs = []; let times = 0; @@ -198,6 +195,7 @@ export function driverE2ETestSuite(DriverClass, defaultCaps = {}) { headers: { 'X-Idempotency-Key': '12345', }, + httpAgent, } ) );