microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.79k stars 3.66k forks source link

[BUG] Debug Test crashing extension host #27372

Closed NeonWizard closed 1 year ago

NeonWizard commented 1 year ago

Context:

Describe the bug

Running "Debug Test" on any playwright test causes Debug adapter process has terminated unexpectedly (Extension host shut down). This started happening a couple months ago, I've tried downgrading to older playwright / playwright extension versions and reinstalling with no luck. Running tests normally ("Run Test") works fine.

2023-09-29 16:24:12.588 [info] Extension host with pid 85375 started
2023-09-29 16:24:12.588 [info] Skipping acquiring lock for /Users/wmiravete/Library/Application Support/Code/User/workspaceStorage/4559e0cf32876789d83b446f10342b53.
2023-09-29 16:24:12.815 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2023-09-29 16:24:12.824 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:typescript'
2023-09-29 16:24:12.855 [info] ExtensionService#_doActivateExtension xaver.clang-format, startup: false, activationEvent: 'onLanguage:typescript'
2023-09-29 16:24:13.285 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git
2023-09-29 16:24:13.287 [info] ExtensionService#_doActivateExtension nicollasr.vscode-streamdeck, startup: true, activationEvent: '*'
2023-09-29 16:24:13.305 [info] ExtensionService#_doActivateExtension vscode.npm, startup: true, activationEvent: 'workspaceContains:package.json'
2023-09-29 16:24:13.608 [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
2023-09-29 16:24:13.644 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2023-09-29 16:24:13.728 [info] ExtensionService#_doActivateExtension golang.go, startup: true, activationEvent: 'workspaceContains:*.go,*/*.go,*/*/*.go'
2023-09-29 16:24:13.812 [info] ExtensionService#_doActivateExtension ms-playwright.playwright, startup: true, activationEvent: 'workspaceContains:**/*playwright*.config.{ts,js,mjs}'
2023-09-29 16:24:13.933 [info] ExtensionService#_doActivateExtension ms-vscode.makefile-tools, startup: true, activationEvent: 'workspaceContains:**/makefile,**/Makefile,**/GNUmakefile'
2023-09-29 16:24:14.074 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
2023-09-29 16:24:14.743 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2023-09-29 16:24:16.467 [info] Eager extensions activated
2023-09-29 16:24:16.468 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:24:16.469 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:24:16.480 [info] ExtensionService#_doActivateExtension alefragnani.Bookmarks, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:24:16.487 [info] ExtensionService#_doActivateExtension dbaeumer.vscode-eslint, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:24:16.503 [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:24:16.559 [info] ExtensionService#_doActivateExtension esbenp.prettier-vscode, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:24:16.600 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-containers, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:24:16.642 [info] ExtensionService#_doActivateExtension waderyan.gitblame, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:24:43.806 [error] TypeError: Cannot read properties of undefined (reading 'webview')
    at Be._updateActions (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:21:4813)
    at n.value (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:21:1602)
    at m.w (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:1902)
    at m.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:2119)
    at Ne.willRunTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:19:419)
    at Oe.debugTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:14:6999)
    at De.debugTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:90:3506)
    at Ve._runTest (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:95:101)
    at Ve._runMatchingTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:91:8493)
    at Timeout._onTimeout (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:91:7633)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)
2023-09-29 16:24:44.996 [info] ExtensionService#_doActivateExtension vscode.debug-server-ready, startup: false, activationEvent: 'onDebugResolve'
2023-09-29 16:24:45.000 [info] ExtensionService#_doActivateExtension ms-vscode.js-debug, startup: false, activationEvent: 'onDebugResolve:pwa-node'
2023-09-29 16:25:08.927 [info] Extension host with pid 87124 started
2023-09-29 16:25:08.927 [info] Skipping acquiring lock for /Users/wmiravete/Library/Application Support/Code/User/workspaceStorage/4559e0cf32876789d83b446f10342b53.
2023-09-29 16:25:08.938 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2023-09-29 16:25:08.948 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:typescript'
2023-09-29 16:25:08.961 [info] ExtensionService#_doActivateExtension xaver.clang-format, startup: false, activationEvent: 'onLanguage:typescript'
2023-09-29 16:25:08.971 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
2023-09-29 16:25:08.977 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2023-09-29 16:25:08.986 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: false, activationEvent: 'onFileSystem:git', root cause: vscode.git
2023-09-29 16:25:08.987 [info] ExtensionService#_doActivateExtension vscode.debug-server-ready, startup: false, activationEvent: 'onDebugResolve'
2023-09-29 16:25:08.995 [info] ExtensionService#_doActivateExtension ms-vscode.js-debug, startup: false, activationEvent: 'onDebugResolve:pwa-node'
2023-09-29 16:25:09.143 [info] ExtensionService#_doActivateExtension vscode.git, startup: false, activationEvent: 'onFileSystem:git'
2023-09-29 16:25:09.316 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2023-09-29 16:25:09.324 [info] ExtensionService#_doActivateExtension nicollasr.vscode-streamdeck, startup: true, activationEvent: '*'
2023-09-29 16:25:09.382 [info] ExtensionService#_doActivateExtension vscode.npm, startup: true, activationEvent: 'workspaceContains:package.json'
2023-09-29 16:25:09.439 [info] ExtensionService#_doActivateExtension golang.go, startup: true, activationEvent: 'workspaceContains:*.go,*/*.go,*/*/*.go'
2023-09-29 16:25:09.484 [info] ExtensionService#_doActivateExtension ms-playwright.playwright, startup: true, activationEvent: 'workspaceContains:**/*playwright*.config.{ts,js,mjs}'
2023-09-29 16:25:09.515 [info] ExtensionService#_doActivateExtension ms-vscode.makefile-tools, startup: true, activationEvent: 'workspaceContains:**/makefile,**/Makefile,**/GNUmakefile'
2023-09-29 16:25:10.886 [info] Eager extensions activated
2023-09-29 16:25:10.886 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:25:10.892 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:25:10.896 [info] ExtensionService#_doActivateExtension alefragnani.Bookmarks, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:25:10.899 [info] ExtensionService#_doActivateExtension dbaeumer.vscode-eslint, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:25:10.904 [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:25:10.920 [info] ExtensionService#_doActivateExtension esbenp.prettier-vscode, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:25:10.946 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-containers, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:25:10.965 [info] ExtensionService#_doActivateExtension waderyan.gitblame, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:25:28.626 [error] TypeError: Cannot read properties of undefined (reading 'webview')
    at Be._updateActions (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:21:4813)
    at n.value (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:21:1602)
    at m.w (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:1902)
    at m.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:2119)
    at Ne.didRunTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:19:744)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Oe.runTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:14:5051)
    at async De.runTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:90:3343)
    at async Ve._runTest (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:95:177)
    at async Ve._runMatchingTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:91:8482)
    at async Timeout._onTimeout (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:91:7622)
2023-09-29 16:25:34.831 [error] TypeError: Cannot read properties of undefined (reading 'webview')
    at Be._updateActions (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:21:4813)
    at n.value (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:21:1602)
    at m.w (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:1902)
    at m.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:2119)
    at Ne.willRunTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:19:419)
    at Oe.debugTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:14:6999)
    at De.debugTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:90:3506)
    at Ve._runTest (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:95:101)
    at Ve._runMatchingTests (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:91:8493)
    at Timeout._onTimeout (/Users/wmiravete/.vscode/extensions/ms-playwright.playwright-1.0.15/out/extension.js:91:7633)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)
2023-09-29 16:25:59.887 [info] Extension host with pid 87389 started
2023-09-29 16:25:59.888 [info] Skipping acquiring lock for /Users/wmiravete/Library/Application Support/Code/User/workspaceStorage/4559e0cf32876789d83b446f10342b53.
2023-09-29 16:25:59.901 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2023-09-29 16:25:59.904 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:typescript'
2023-09-29 16:25:59.919 [info] ExtensionService#_doActivateExtension xaver.clang-format, startup: false, activationEvent: 'onLanguage:typescript'
2023-09-29 16:25:59.930 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
2023-09-29 16:25:59.937 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2023-09-29 16:25:59.949 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: false, activationEvent: 'onFileSystem:git', root cause: vscode.git
2023-09-29 16:25:59.953 [info] ExtensionService#_doActivateExtension vscode.debug-server-ready, startup: false, activationEvent: 'onDebugResolve'
2023-09-29 16:25:59.955 [info] ExtensionService#_doActivateExtension ms-vscode.js-debug, startup: false, activationEvent: 'onDebugResolve:pwa-node'
2023-09-29 16:26:00.089 [info] ExtensionService#_doActivateExtension vscode.git, startup: false, activationEvent: 'onFileSystem:git'
2023-09-29 16:26:00.310 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2023-09-29 16:26:00.315 [info] ExtensionService#_doActivateExtension nicollasr.vscode-streamdeck, startup: true, activationEvent: '*'
2023-09-29 16:26:00.359 [info] ExtensionService#_doActivateExtension vscode.npm, startup: true, activationEvent: 'workspaceContains:package.json'
2023-09-29 16:26:00.444 [info] ExtensionService#_doActivateExtension golang.go, startup: true, activationEvent: 'workspaceContains:*.go,*/*.go,*/*/*.go'
2023-09-29 16:26:00.493 [info] ExtensionService#_doActivateExtension ms-playwright.playwright, startup: true, activationEvent: 'workspaceContains:**/*playwright*.config.{ts,js,mjs}'
2023-09-29 16:26:00.522 [info] ExtensionService#_doActivateExtension ms-vscode.makefile-tools, startup: true, activationEvent: 'workspaceContains:**/makefile,**/Makefile,**/GNUmakefile'
2023-09-29 16:26:02.312 [info] Eager extensions activated
2023-09-29 16:26:02.312 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:26:02.315 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:26:02.320 [info] ExtensionService#_doActivateExtension alefragnani.Bookmarks, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:26:02.324 [info] ExtensionService#_doActivateExtension dbaeumer.vscode-eslint, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:26:02.330 [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:26:02.348 [info] ExtensionService#_doActivateExtension esbenp.prettier-vscode, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:26:02.367 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-containers, startup: false, activationEvent: 'onStartupFinished'
2023-09-29 16:26:02.386 [info] ExtensionService#_doActivateExtension waderyan.gitblame, startup: false, activationEvent: 'onStartupFinished'
yury-s commented 1 year ago

Can you share the project where it happens and the steps?

NeonWizard commented 1 year ago

Can't share the project, but here is a minimal reproducible example with a video. Watch the whole thing, the crash takes a bit.

https://github.com/microsoft/playwright/assets/1355586/b19879f9-f795-4784-a83b-52b08689a8b9

import { test } from '@playwright/test'

test.describe('Sample Test', () => {
  test('this crashes', async () => {
    return
  })
})
pavelfeldman commented 1 year ago

I believe this is fixed in 1.16 that did not publish.

pavelfeldman commented 1 year ago

Should be published now. Please give it a try and tell us if it helped!

pavelfeldman commented 1 year ago

Closing as per above, please feel free to open a new issue if this does not cover your use case.

NeonWizard commented 1 year ago

Looks like this is an issue in the base VSCode javascript debugger

https://github.com/microsoft/vscode/issues/196140