microsoft / microsoft/vscode-extension-samples

helloworld-test-sample failed when rerun

Open
#1,016 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
10.2k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Description

Extension sample

helloworld-test-sample

VS Code version

1.89.0

What went wrong?

I did the following on Mac

  • clone this repo
  • cd helloworld-test-sample
  • npm install
  • npm test
  • test was passed
  Extension Test Suite
    ✔ Sample test
  1 passing (1ms)
[main 2024-05-03T20:24:49.474Z] Extension host with pid 94860 exited with code: 0, signal: unknown.
Exit code:   0
Done

When I ran npm test again, I got error:

Found existing install in /Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/vscode-darwin-arm64-1.89.0. Skipping download
2024-05-03 16:24:55.315 Electron[94994:16431137] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
WARNING: IPC handle "/Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/user-data/1.89-main.sock" is longer than 103 chars, try a shorter --user-data-dir
[main 2024-05-03T20:24:55.385Z] Could not delete obsolete instance handle Error: ENOENT: no such file or directory, unlink '/Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/user-data/1.89-main.sock'
    at unlinkSync (node:original-fs:1904:3)
    at ke.f (/Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/vscode-darwin-arm64-1.89.0/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:112:4193)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/vscode-darwin-arm64-1.89.0/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:112:1240
    at async ke.a (/Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/vscode-darwin-arm64-1.89.0/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:112:1127) {
  errno: -2,
  syscall: 'unlink',
  code: 'ENOENT',
  path: '/Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/user-data/1.89-main.sock'
}
[main 2024-05-03T20:24:55.386Z] Error: ENOENT: no such file or directory, unlink '/Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/user-data/1.89-main.sock'
    at unlinkSync (node:original-fs:1904:3)
    at ke.f (/Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/vscode-darwin-arm64-1.89.0/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:112:4193)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/vscode-darwin-arm64-1.89.0/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:112:1240
    at async ke.a (/Users/gkwan/tasks/CNAI/guides/working/openapi-generator/vscode-extension-samples/helloworld-test-sample/.vscode-test/vscode-darwin-arm64-1.89.0/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:112:1127)
Exit code:   1
Failed to run tests

I expect no error when run the test again

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the helloworld-test-sample test setup and inspect the npm test entry point, especially how .vscode-test/user-data and the downloaded VS Code instance are reused. Reproduce by running npm test twice on macOS, then verify that repeated runs do not fail while cleaning up the 1.89-main.sock handle.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript, vscode
Domain
developer-experience, testing, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.