Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: The first argument of GetProcessCpuUsage, callback, must be an array. #137030

Open
bpasero opened this issue Nov 12, 2021 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) workbench-diagnostics General VS Code built-in diagnostic issues
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Nov 12, 2021

Running integration tests on Windows:

 vscode API - tasks
    Tasks
      ShellExecution
[9732:1112/103152.965:INFO:CONSOLE(104)] "%c[IPC Library: Pty Host] %cUncaught Exception:  color: blue color:  TypeError: The first argument of GetProcessCpuUsage, callback, must be an array.
    at Object.getProcessCpuUsage (c:\GitDevelopment\monaco\node_modules\windows-process-tree\lib\index.js:98:12)
    at Object.callback (c:\GitDevelopment\monaco\out\vs\base\node\ps.js:109:44)
    at c:\GitDevelopment\monaco\node_modules\windows-process-tree\lib\index.js:75:19
    at Array.forEach (<anonymous>)
    at c:\GitDevelopment\monaco\node_modules\windows-process-tree\lib\index.js:74:19", source: vscode-file://vscode-app/c:/GitDevelopment/monaco/out/vs/base/common/console.js (104)
        √ Execution from onDidEndTaskProcess and onDidStartTaskProcess are equal to original (1840ms)
        √ dependsOn task should start with a different processId (#118256) (2964ms)
@alexr00
Copy link
Member

alexr00 commented Nov 12, 2021

I can't get this to repro during tasks tests, but I do see it during terminal. @Tyriar do you know anything about windows-process-tree?

?[0m  vscode API - terminal?[0m
?[0m    Terminal?[0m
    ?[32m  √?[0m?[90m sendText immediately after createTerminal should not throw?[0m
    ?[32m  √?[0m?[90m echo works in the default shell?[0m?[31m (2540ms)?[0m
    ?[32m  √?[0m?[90m onDidCloseTerminal event fires when terminal is disposed?[0m
    ?[32m  √?[0m?[90m processId immediately after createTerminal should fetch the pid?[0m?[31m (425ms)?[0m
    ?[32m  √?[0m?[90m name in constructor should set terminal.name?[0m
    ?[32m  √?[0m?[90m creationOptions should be set and readonly for TerminalOptions terminals?[0m
    ?[32m  √?[0m?[90m onDidOpenTerminal should fire when a terminal is created?[0m
    ?[32m  √?[0m?[90m exitStatus.code should be set to undefined after a terminal is disposed?[0m
    ?[32m  √?[0m?[90m onDidChangeTerminalState should fire after writing to a terminal?[0m?[31m (402ms)?[0m
?[0m      hideFromUser?[0m
      ?[32m  √?[0m?[90m should be available to terminals API?[0m
?[0m      window.onDidWriteTerminalData?[0m
      ?[32m  √?[0m?[90m should listen to all future terminal data events?[0m?[31m (273ms)?[0m
?[0m      Extension pty terminals?[0m
      ?[32m  √?[0m?[90m should fire onDidOpenTerminal and onDidCloseTerminal?[0m
      ?[32m  √?[0m?[90m should respect dimension overrides?[0m?[31m (140ms)?[0m
      ?[32m  √?[0m?[90m should change terminal name?[0m?[31m (121ms)?[0m
      ?[32m  √?[0m?[90m exitStatus.code should be set to the exit code (undefined)?[0m?[31m (106ms)?[0m
      ?[32m  √?[0m?[90m exitStatus.code should be set to the exit code (zero)?[0m?[31m (114ms)?[0m
The terminal process terminated with exit code: 22.
      ?[32m  √?[0m?[90m exitStatus.code should be set to the exit code (non-zero)?[0m?[31m (619ms)?[0m
      ?[32m  √?[0m?[90m creationOptions should be set and readonly for ExtensionTerminalOptions terminals?[0m
?[0m      environmentVariableCollection?[0m
      ?[36m  - should have collection variables apply to terminals immediately after setting?[0m
      ?[32m  √?[0m?[90m should have collection variables apply to environment variables that don't exist?[0m?[31m (1415ms)?[0m
rejected promise not handled within 1 second: undefined
      ?[32m  √?[0m?[90m should respect clearing entries?[0m?[31m (1253ms)?[0m
[27240:1112/105539.062:INFO:CONSOLE(104)] "%c[IPC Library: Pty Host] %cUncaught Exception:  color: blue color:  TypeError: The first argument of GetP
rocessCpuUsage, callback, must be an array.
    at Object.getProcessCpuUsage (d:\repos\Microsoft\vscode\node_modules\windows-process-tree\lib\index.js:98:12)
    at Object.callback (d:\repos\Microsoft\vscode\out\vs\base\node\ps.js:109:44)
    at d:\repos\Microsoft\vscode\node_modules\windows-process-tree\lib\index.js:75:19
    at Array.forEach (<anonymous>)
    at d:\repos\Microsoft\vscode\node_modules\windows-process-tree\lib\index.js:74:19", source: vscode-file://vscode-app/d:/repos/Microsoft/vscode/ou
t/vs/base/common/console.js (104)
      ?[32m  √?[0m?[90m should respect deleting entries?[0m?[31m (1333ms)?[0m

@alexr00 alexr00 assigned Tyriar and unassigned alexr00 Nov 12, 2021
@bpasero
Copy link
Member Author

bpasero commented Nov 12, 2021

When this reproduces (not always), windowsProcessTree.getProcessList returns undefined. So it looks like the typing is wrong for that library.

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) workbench-diagnostics General VS Code built-in diagnostic issues labels Dec 21, 2021
@Tyriar Tyriar added this to the Backlog milestone Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) workbench-diagnostics General VS Code built-in diagnostic issues
Projects
None yet
Development

No branches or pull requests

3 participants