vscode-test: VS Code executable not found after downloading it

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: Insiders
  • OS Version: Windows

CI logs https://github.com/microsoft/vscode-jupyter/actions/runs/6940223424/job/18878834977 I am downloading VS Code using the package @vscode/test-electron

I have noticed that the windows tests can fail sometimes due to some file not found error (see below). Re-running the CI seems to fix it (hence the reason I think its flaky)

Please let me know if additional information/logs are required.

Here are the logs from the Jupyter CI

Run GabrielBB/xvfb-action@v1.4
C:\Windows\system32\cmd.exe /D /S /C "C:\hostedtoolcache\windows\node\18.15.0\x64\npm.cmd run testSmokeLogged"

> jupyter@2023.11.100 testSmokeLogged
> cross-env VSC_JUPYTER_FORCE_LOGGING=true node --no-force-async-hooks-checks ./out/test/testBootstrap.node.js ./out/test/smokeTest.node.js

Starting socket server for tests.
Creating test server
Listening to test server
Test server running
Test server listening on port 53222
Spawning C:\hostedtoolcache\windows\node\18.15.0\x64\node.exe : ./out/test/smokeTest.node.js
Python used in tests is c:\hostedtoolcache\windows\python\3.10.11\x64\python.exe
Start Test Runner
Launch tests in test runner
****************************************************************************************************
Start Standard tests
Downloading VS Code insiders from https://update.code.visualstudio.com/latest/win32-x64-archive/insider
Downloading VS Code (131091780B)
Downloading VS Code [=-----------------------------] 6%Downloading VS Code [=====-------------------------] 17%Downloading VS Code [=========---------------------] 33%Downloading VS Code [==============----------------] 48%Downloading VS Code [===================-----------] 64%Downloading VS Code [====================----------] 69%Downloading VS Code [=====================---------] 71%Downloading VS Code [======================--------] 74%Downloading VS Code [=======================-------] 77%Downloading VS Code [=======================-------] 80%Downloading VS Code [=========================-----] 85%Downloading VS Code [==========================----] 90%Downloading VS Code [============================--] 94%Downloaded VS Code into D:\a\vscode-jupyter\vscode-jupyter\.vscode-test\vscode-win32-x64-archive-insiders
Downloaded VS Code into D:\a\vscode-jupyter\vscode-jupyter\.vscode-test\vscode-win32-x64-archive-insiders
Installing Python Extension ms-python.python to C:\Users\RUNNER~1\AppData\Local\Temp\vscode_jupyter_exts
Installing Pylance Extension to C:\Users\RUNNER~1\AppData\Local\Temp\vscode_jupyter_exts
Installing Renderer Extension to C:\Users\RUNNER~1\AppData\Local\Temp\vscode_jupyter_exts
Test error: Error: spawn D:\a\vscode-jupyter\vscode-jupyter\.vscode-test\vscode-win32-x64-archive-insiders\Code - Insiders.exe ENOENT
Exit code:   -4058
End Standard tests (with errors) Failed
****************************************************************************************************
Start Standard tests
End Standard tests (with errors) Error: ENOENT: no such file or directory, open 'D:\a\vscode-jupyter\vscode-jupyter\.vscode-test\vscode-win32-x64-archive-insiders\resources\app\product.json'
    at Object.openSync (node:fs:601:3)
    at Object.readFileSync (node:fs:469:[35](https://github.com/microsoft/vscode-jupyter/actions/runs/6940223424/job/18878834977#step:13:36))
    at Object.insidersDownloadDirMetadata (D:\a\vscode-jupyter\vscode-jupyter\node_modules\@vscode\test-electron\out\util.js:114:41)
    at download (D:\a\vscode-jupyter\vscode-jupyter\node_modules\@vscode\test-electron\out\download.js:281:72)
    at downloadAndUnzipVSCode (D:\a\vscode-jupyter\vscode-jupyter\node_modules\@vscode\test-electron\out\download.js:[36](https://github.com/microsoft/vscode-jupyter/actions/runs/6940223424/job/18878834977#step:13:37)1:18)
    at start (D:\a\vscode-jupyter\vscode-jupyter\out\test\standardTest.node.js:144:83)
    at D:\a\vscode-jupyter\vscode-jupyter\out\test\standardTest.node.js:177:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -[40](https://github.com/microsoft/vscode-jupyter/actions/runs/6940223424/job/18878834977#step:13:41)[58](https://github.com/microsoft/vscode-jupyter/actions/runs/6940223424/job/18878834977#step:13:59),
  syscall: 'open',
  code: 'ENOENT',
  path: 'D:\\a\\vscode-jupyter\\vscode-jupyter\\.vscode-test\\vscode-win32-x[64](https://github.com/microsoft/vscode-jupyter/actions/runs/6940223424/job/18878834977#step:13:65)-archive-insiders\\resources\\app\\product.json'
}
Tests Exited with code 1
Error in running Smoke Tests Failed with code 1.
Exiting with test failures
Killing VSC
Error: The process 'C:\hostedtoolcache\windows\node\18.15.0\x64\npm.cmd' failed with exit code 1

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 25 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Found the issue. It’s indeed related to the new CDN.

We’re relying on the Content-Type header to detect whether the download is a ZIP or a TGZ: https://github.com/microsoft/vscode-test/blob/c1a49663d17d86c76cc74c1a7ac4d955d1906d73/lib/download.ts#L223

The new CDN unfortunately always sends application/octet-stream:

➜  ~ http -F -h https://update.code.visualstudio.com/latest/darwin-arm64/insider
HTTP/1.1 200 OK
Accept-Ranges: bytes
Age: 12449
ApiVersion: Distribute 1.1
Cache-Control: public, max-age=86400
Content-Disposition: attachment; filename=VSCode-darwin-arm64.zip; filename*=UTF-8''VSCode-darwin-arm64.zip
Content-Length: 123910672
Content-Type: application/octet-stream
Date: Fri, 24 Nov 2023 10:43:49 GMT
Etag: "0xA44299607ACF10F270F36D79ADF383369949B4C0BE16DEAFEC16D8071E72B32A"
Last-Modified: Fri, 24 Nov 2023 06:29:55 GMT
Server: ECAcc (mil/6BBD)
X-Cache: HIT

➜  ~ http -F -h https://update.code.visualstudio.com/latest/darwin-arm64/stable
HTTP/1.1 200 OK
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: x-ms-request-id,x-ms-version,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type
Age: 1268675
Cache-Control: max-age=31536000, public
Content-Disposition: attachment; filename="VSCode-darwin-arm64.zip"
Content-Length: 125047073
Content-MD5: g75j7rfjdHvKVTNfWLbMQg==
Content-Type: application/zip
Date: Fri, 24 Nov 2023 10:43:54 GMT
Etag: "0x8DBE11687A6A0BA"
Last-Modified: Thu, 09 Nov 2023 11:25:08 GMT
Server: ECAcc (mil/6C9A)
X-Cache: HIT
x-ms-blob-type: BlockBlob
x-ms-lease-state: available
x-ms-lease-status: unlocked
x-ms-request-id: e891b733-401e-0035-0d39-13490d000000
x-ms-version: 2013-08-15

This explains why Windows and macOS are broken, while Linux isn’t: the ZIP archives are incorrectly “detected” as TGZ.

Thank you for looking into and fixing this! I’m surprised this didn’t surface in a more explicit way. I owe you a testing/debug bug fix of your choice 😁

Fixed in 2.3.8, pipeline running