From e1a1f7983e508c388f832556236fe4e8fc12c314 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Tue, 24 Jan 2023 14:49:15 -0500 Subject: [PATCH] Increase timeout on Windows to 25s in previously missed locations Most of the timeouts for tests are the mocha timeouts, but DebugClient has its own timeout values. This change synchronizes those values. This increased timeout is specifically needed for the attachRemote test which takes more than 5 seconds to do the initial connection on the GitHub actions build regularly. This is a follow up to commit 3708cea2e0833e0d48fbcc7ca1e4718894c9809e part of #222 --- .mocharc-windows-ci.json | 1 + .mocharc.json | 1 + src/integration-tests/debugClient.ts | 3 +++ 3 files changed, 5 insertions(+) diff --git a/.mocharc-windows-ci.json b/.mocharc-windows-ci.json index 23d229cb..9d756fd8 100644 --- a/.mocharc-windows-ci.json +++ b/.mocharc-windows-ci.json @@ -1,3 +1,4 @@ { + "//": "This timeout should match what is in CdtDebugClient constructor", "timeout": "25000" } diff --git a/.mocharc.json b/.mocharc.json index b1f5707d..bca73d03 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -1,3 +1,4 @@ { + "//": "This timeout should match what is in CdtDebugClient constructor", "timeout": "5000" } diff --git a/src/integration-tests/debugClient.ts b/src/integration-tests/debugClient.ts index 289f3781..a8e6f38b 100644 --- a/src/integration-tests/debugClient.ts +++ b/src/integration-tests/debugClient.ts @@ -12,6 +12,7 @@ import { DebugClient } from '@vscode/debugadapter-testsupport'; import { DebugProtocol } from '@vscode/debugprotocol'; import * as path from 'path'; import { defaultAdapter } from './utils'; +import * as os from 'os'; export type ReverseRequestHandler< A = any, @@ -51,6 +52,8 @@ export class CdtDebugClient extends DebugClient { if (extraArgs) { this._cdt_args.push(...extraArgs); } + // These timeouts should match what is in .mocharc.json and .mocharc-windows-ci.json + this.defaultTimeout = os.platform() === 'win32' ? 25000 : 5000; } /**