From 407d9757f0766efdcf75a7f9fa5bec1a7e032aaa Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Wed, 12 Aug 2026 18:38:20 -0400 Subject: [PATCH] CI: make the Windows Electron download retry actually retry (#330536) Make the Windows Electron download retry actually retry The step wraps the download in a 3-attempt loop, but the retry never fired. `npm exec` is a native command, and a non-zero exit code from a native command does not raise a terminating error in PowerShell, so the `catch` block was unreachable: the first attempt fell through to `break` and the step then failed on the non-zero exit code. Wrap the call in `exec { }` from build/azure-pipelines/win32/exec.ps1, which checks $lastexitcode and throws. This is the same shape the `npm ci` retry in this file already uses, and it is why that one works. Seen on a PR run where a transient socket close while fetching Electron from github.com failed the job on the first attempt, with no retry: TypeError: fetch failed cause: SocketError: other side closed (UND_ERR_SOCKET) at @vscode/gulp-electron/src/download.js The Linux and macOS workflows are unaffected: their loops use `if npm exec ...; then`, which tests the exit code directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3c35355f-4d36-46e5-8d7a-cb0bc7207449 --- .github/workflows/pr-win32-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-win32-test.yml b/.github/workflows/pr-win32-test.yml index 2c7a0b48c0e..eb027c9113c 100644 --- a/.github/workflows/pr-win32-test.yml +++ b/.github/workflows/pr-win32-test.yml @@ -115,9 +115,12 @@ jobs: - name: Download Electron and Playwright shell: pwsh run: | + . build/azure-pipelines/win32/exec.ps1 + $ErrorActionPreference = "Stop" + for ($i = 1; $i -le 3; $i++) { try { - npm exec -- npm-run-all2 -lp "electron ${{ env.VSCODE_ARCH }}" "playwright-install" + exec { npm exec -- npm-run-all2 -lp "electron ${{ env.VSCODE_ARCH }}" "playwright-install" } break } catch {