From 3c44d194c1e0dbeb6d39b0847756def6bc255f9f Mon Sep 17 00:00:00 2001 From: tupe12334 Date: Mon, 19 Oct 2026 16:09:12 +0300 Subject: [PATCH] fix(install): pass -NoProfile -NonInteractive to PowerShell archive extraction PowerShell loads user profiles by default. On Windows CI runners this adds several seconds to each spawn. The Expand-Archive test spawns PowerShell twice (Compress-Archive for setup, Expand-Archive in extractZip), so it exceeded the 5000 ms default timeout. - extract.ts: add -NoProfile -NonInteractive to the Expand-Archive call. This also speeds up installs for users. - binary-installation spec: same flags on the setup Compress-Archive call, and an explicit 30000 ms timeout on that single test. Co-Authored-By: Claude Haiku 5.5 --- .../install-daemon/binary-installation.integration.spec.ts | 6 ++++-- src/lib/install-daemon/extract.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/install-daemon/binary-installation.integration.spec.ts b/src/lib/install-daemon/binary-installation.integration.spec.ts index d390917..130f804 100644 --- a/src/lib/install-daemon/binary-installation.integration.spec.ts +++ b/src/lib/install-daemon/binary-installation.integration.spec.ts @@ -238,6 +238,7 @@ describe('binary installation - PowerShell Expand-Archive on Windows', () => { tempDirs.length = 0 }) + // PowerShell cold start on CI Windows runners takes several seconds per spawn (two here). skipOnUnix( 'should extract .zip archives using PowerShell Expand-Archive on Windows', () => { @@ -251,7 +252,7 @@ describe('binary installation - PowerShell Expand-Archive on Windows', () => { // Create zip using PowerShell const archivePath = join(tempDir, 'centy-daemon.zip') execSync( - `powershell -Command "Compress-Archive -Path '${join(srcDir, 'centy-daemon.exe')}' -DestinationPath '${archivePath}'"`, + `powershell -NoProfile -NonInteractive -Command "Compress-Archive -Path '${join(srcDir, 'centy-daemon.exe')}' -DestinationPath '${archivePath}'"`, { stdio: 'pipe' } ) @@ -259,7 +260,8 @@ describe('binary installation - PowerShell Expand-Archive on Windows', () => { extractArchive(archivePath, destDir) expect(existsSync(join(destDir, 'centy-daemon.exe'))).toBe(true) - } + }, + 30000 ) }) diff --git a/src/lib/install-daemon/extract.ts b/src/lib/install-daemon/extract.ts index 47a6495..3b235e1 100644 --- a/src/lib/install-daemon/extract.ts +++ b/src/lib/install-daemon/extract.ts @@ -24,7 +24,7 @@ function extractZip(archivePath: string, destDir: string): void { ensureDir(destDir) if (isWindows()) { execSync( - `powershell -Command "Expand-Archive -Path '${archivePath}' -DestinationPath '${destDir}' -Force"`, + `powershell -NoProfile -NonInteractive -Command "Expand-Archive -Path '${archivePath}' -DestinationPath '${destDir}' -Force"`, { stdio: 'pipe' } ) } else {