From bf6dba345267503e2bfc5fe9fef4dd19ab35d586 Mon Sep 17 00:00:00 2001 From: William Killerud Date: Sun, 3 Nov 2024 11:41:28 +0100 Subject: [PATCH] Try configuring a shorter user-data directory For the socket problem --- extension/src/server.ts | 4 ---- extension/test/electron/run.js | 14 +++++++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/extension/src/server.ts b/extension/src/server.ts index 4a5e45c..8f58ce0 100644 --- a/extension/src/server.ts +++ b/extension/src/server.ts @@ -25,10 +25,6 @@ export async function createServerOptions( }); socketServer.listen( { - // We need a short-ish path to the socket because of - // https://github.com/actions/runner/issues/1676 and - // https://nodejs.org/api/net.html#identifying-paths-for-ipc-connections - path: path.join(os.tmpdir(), 'sass', 'main.sock'), port: 0, }, () => { diff --git a/extension/test/electron/run.js b/extension/test/electron/run.js index 3dfb648..0a6a1ee 100644 --- a/extension/test/electron/run.js +++ b/extension/test/electron/run.js @@ -1,4 +1,5 @@ const path = require('node:path'); +const os = require('node:os'); const fs = require('node:fs/promises'); const { runTests, @@ -45,6 +46,13 @@ async function main() { 'fixtures' ); + const userDataDir = path.join(os.tmpdir(), 'vscode-test', 'user-data'); + try { + await fs.mkdir(userDataDir, { recursive: true }); + } catch { + // might already exist + } + await runTests({ vscodeExecutablePath, version, @@ -52,11 +60,15 @@ async function main() { extensionTestsPath, launchArgs: [ workspaceDir, - ...args, // Turn off the built-in language server to // make sure we're testing our own. '--disable-extension', 'vscode.css-language-features', + // We need a shorter path to the socket because of + // https://github.com/actions/runner/issues/1676 and + // https://nodejs.org/api/net.html#identifying-paths-for-ipc-connections + '--user-data-dir', + userDataDir, ], }); }