From 257b2e9d430b4d203e172b4b563a769912f9eff8 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Fri, 12 Nov 2021 10:41:41 +0100 Subject: [PATCH] Execute `tasklist` to check if there are any leaking processes --- .../win32/product-build-win32.yml | 30 +++++++++++++ .../server/test/test-remote-integration.bat | 17 +++++++ scripts/listprocesses.bat | 3 ++ scripts/test-integration.bat | 44 +++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 scripts/listprocesses.bat diff --git a/build/azure-pipelines/win32/product-build-win32.yml b/build/azure-pipelines/win32/product-build-win32.yml index ccd863c615b..5dc07e92a09 100644 --- a/build/azure-pipelines/win32/product-build-win32.yml +++ b/build/azure-pipelines/win32/product-build-win32.yml @@ -176,6 +176,11 @@ steps: timeoutInMinutes: 10 condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64')) + - powershell: | + . build/azure-pipelines/win32/exec.ps1 + exec {.\scripts\listprocesses.bat } + displayName: List tasks (1) + - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" @@ -184,6 +189,11 @@ steps: timeoutInMinutes: 10 condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64')) + - powershell: | + . build/azure-pipelines/win32/exec.ps1 + exec {.\scripts\listprocesses.bat } + displayName: List tasks (2) + - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" @@ -195,6 +205,11 @@ steps: timeoutInMinutes: 7 condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64')) + - powershell: | + . build/azure-pipelines/win32/exec.ps1 + exec {.\scripts\listprocesses.bat } + displayName: List tasks (3) + - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" @@ -211,6 +226,11 @@ steps: timeoutInMinutes: 5 condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64')) + - powershell: | + . build/azure-pipelines/win32/exec.ps1 + exec {.\scripts\listprocesses.bat } + displayName: List tasks (4) + - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" @@ -221,6 +241,11 @@ steps: timeoutInMinutes: 5 condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64')) + - powershell: | + . build/azure-pipelines/win32/exec.ps1 + exec {.\scripts\listprocesses.bat } + displayName: List tasks (5) + - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" @@ -230,6 +255,11 @@ steps: timeoutInMinutes: 5 condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64')) + - powershell: | + . build/azure-pipelines/win32/exec.ps1 + exec {.\scripts\listprocesses.bat } + displayName: List tasks (6) + - task: PublishPipelineArtifact@0 inputs: artifactName: crash-dump-windows-$(VSCODE_ARCH) diff --git a/resources/server/test/test-remote-integration.bat b/resources/server/test/test-remote-integration.bat index c31dff424d2..06251dc5149 100644 --- a/resources/server/test/test-remote-integration.bat +++ b/resources/server/test/test-remote-integration.bat @@ -43,8 +43,17 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" ( call .\scripts\code.bat --folder-uri=%REMOTE_VSCODE%/vscode-api-tests/testWorkspace --extensionDevelopmentPath=%REMOTE_VSCODE%/vscode-api-tests --extensionTestsPath=%REMOTE_VSCODE%/vscode-api-tests/out/singlefolder-tests %API_TESTS_EXTRA_ARGS% if %errorlevel% neq 0 exit /b %errorlevel% + echo "------------------------------------" + tasklist + echo "------------------------------------" + call .\scripts\code.bat --file-uri=%REMOTE_VSCODE%/vscode-api-tests/testworkspace.code-workspace --extensionDevelopmentPath=%REMOTE_VSCODE%/vscode-api-tests --extensionTestsPath=%REMOTE_VSCODE%/vscode-api-tests/out/workspace-tests %API_TESTS_EXTRA_ARGS% if %errorlevel% neq 0 exit /b %errorlevel% + + echo "------------------------------------" + tasklist + echo "------------------------------------" + ) else ( echo "Storing crash reports into '%VSCODECRASHDIR%'." echo "Storing log files into '%VSCODELOGSDIR%'." @@ -65,8 +74,16 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" ( call "%INTEGRATION_TEST_ELECTRON_PATH%" --folder-uri=%REMOTE_VSCODE%/vscode-api-tests/testWorkspace --extensionDevelopmentPath=%REMOTE_VSCODE%/vscode-api-tests --extensionTestsPath=%REMOTE_VSCODE%/vscode-api-tests/out/singlefolder-tests %API_TESTS_EXTRA_ARGS% --extensions-dir=%EXT_PATH% --enable-proposed-api=vscode.vscode-test-resolver --enable-proposed-api=vscode.vscode-api-tests --enable-proposed-api=vscode.image-preview if %errorlevel% neq 0 exit /b %errorlevel% + echo "------------------------------------" + tasklist + echo "------------------------------------" + call "%INTEGRATION_TEST_ELECTRON_PATH%" --file-uri=%REMOTE_VSCODE%/vscode-api-tests/testworkspace.code-workspace --extensionDevelopmentPath=%REMOTE_VSCODE%/vscode-api-tests --extensionTestsPath=%REMOTE_VSCODE%/vscode-api-tests/out/workspace-tests %API_TESTS_EXTRA_ARGS% --extensions-dir=%EXT_PATH% --enable-proposed-api=vscode.vscode-test-resolver --enable-proposed-api=vscode.vscode-api-tests --enable-proposed-api=vscode.image-preview if %errorlevel% neq 0 exit /b %errorlevel% + + echo "------------------------------------" + tasklist + echo "------------------------------------" ) IF "%3" == "" ( diff --git a/scripts/listprocesses.bat b/scripts/listprocesses.bat new file mode 100644 index 00000000000..e184b37fe56 --- /dev/null +++ b/scripts/listprocesses.bat @@ -0,0 +1,3 @@ +echo "------------------------------------" +tasklist +echo "------------------------------------" diff --git a/scripts/test-integration.bat b/scripts/test-integration.bat index 3da6d3c9e62..84e86db4cf4 100644 --- a/scripts/test-integration.bat +++ b/scripts/test-integration.bat @@ -50,6 +50,10 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" ( call .\scripts\test.bat --runGlob **\*.integrationTest.js %* if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + :: Tests in the extension host @@ -58,41 +62,81 @@ set ALL_PLATFORMS_API_TESTS_EXTRA_ARGS=--disable-telemetry --skip-welcome --skip call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\singlefolder-tests %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS% if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\workspace-tests %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS% if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS% if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\typescript-language-features\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\typescript-language-features --extensionTestsPath=%~dp0\..\extensions\typescript-language-features\out\test\unit --enable-proposed-api=vscode.typescript-language-features %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS% if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\markdown-language-features\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\markdown-language-features --extensionTestsPath=%~dp0\..\extensions\markdown-language-features\out\test %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS% if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\emmet\test-workspace --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS% if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + for /f "delims=" %%i in ('node -p "require('fs').realpathSync.native(require('os').tmpdir())"') do set TEMPDIR=%%i set GITWORKSPACE=%TEMPDIR%\git-%RANDOM% mkdir %GITWORKSPACE% call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --enable-proposed-api=vscode.git %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS% if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + set IPYNBWORKSPACE=%TEMPDIR%\ipynb-%RANDOM% mkdir %IPYNBWORKSPACE% call "%INTEGRATION_TEST_ELECTRON_PATH%" %IPYNBWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\ipynb --extensionTestsPath=%~dp0\..\extensions\ipynb\out\test %ALL_PLATFORMS_API_TESTS_EXTRA_ARGS% if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + :: Tests standalone (CommonJS) call %~dp0\node-electron.bat %~dp0\..\extensions\css-language-features/server/test/index.js if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + call %~dp0\node-electron.bat %~dp0\..\extensions\html-language-features/server/test/index.js if %errorlevel% neq 0 exit /b %errorlevel% +echo "------------------------------------" +tasklist +echo "------------------------------------" + rmdir /s /q %VSCODEUSERDATADIR% popd