microsoft / vscode-extension-samples

Sample code illustrating the VS Code extension API.
MIT License
8.75k stars 3.42k forks source link

helloworld-test-sample failed when rerun #1016

Open gkwan-ibm opened 6 months ago

gkwan-ibm commented 6 months ago

Extension sample

helloworld-test-sample

VS Code version

1.89.0

What went wrong?

I did the following on Mac

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

gkwan-ibm commented 6 months ago

Then, I removed the .vscode-test and ran the npm test, the error still occurred.

gkwan-ibm commented 6 months ago

I found the workaround: