From 1f332c09f25e1610b731bfdd86ba039107879d83 Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Wed, 9 Nov 2016 14:23:19 -0800 Subject: [PATCH 1/7] kill build processes before perf run --- cibuild.cmd | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cibuild.cmd b/cibuild.cmd index a0fbf66e09000..a0517d0ac4ea6 100644 --- a/cibuild.cmd +++ b/cibuild.cmd @@ -105,6 +105,7 @@ if defined TestPerfRun ( ) ) + call :TerminateBuildProcesses .\Binaries\%BuildConfiguration%\Exes\Perf.Runner\Roslyn.Test.Performance.Runner.exe --no-trace-upload !EXTRA_PERF_RUNNER_ARGS! || goto :BuildFailed exit /b 0 ) @@ -137,6 +138,7 @@ exit /b 0 :BuildFailed echo Build failed with ERRORLEVEL %ERRORLEVEL% call :TerminateBuildProcesses +:ActuallyFail exit /b 1 :TerminateBuildProcesses @@ -146,4 +148,13 @@ exit /b 1 @REM left some floating around). taskkill /F /IM vbcscompiler.exe 2> nul +if ERRORLEVEL 1 GOTO ActuallyFail + taskkill /F /IM msbuild.exe 2> nul +if ERRORLEVEL 1 GOTO ActuallyFail + +taskkill /F /IM csc.exe 2> nul +if ERRORLEVEL 1 GOTO ActuallyFail + +taskkill /F /IM vbc.exe 2> nul +if ERRORLEVEL 1 GOTO ActuallyFail From c0fcdc1be8fbd1797a3fda098995abe4e91d5ed7 Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Wed, 9 Nov 2016 15:56:12 -0800 Subject: [PATCH 2/7] only ignore success when killing processes --- cibuild.cmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cibuild.cmd b/cibuild.cmd index a0517d0ac4ea6..98ef63adcee61 100644 --- a/cibuild.cmd +++ b/cibuild.cmd @@ -147,14 +147,14 @@ exit /b 1 @REM Kill any instances of msbuild.exe to ensure that we never reuse nodes (e.g. if a non-roslyn CI run @REM left some floating around). -taskkill /F /IM vbcscompiler.exe 2> nul +taskkill /F /IM vbcscompiler.exe > nul if ERRORLEVEL 1 GOTO ActuallyFail -taskkill /F /IM msbuild.exe 2> nul +taskkill /F /IM msbuild.exe > nul if ERRORLEVEL 1 GOTO ActuallyFail -taskkill /F /IM csc.exe 2> nul +taskkill /F /IM csc.exe > nul if ERRORLEVEL 1 GOTO ActuallyFail -taskkill /F /IM vbc.exe 2> nul +taskkill /F /IM vbc.exe > nul if ERRORLEVEL 1 GOTO ActuallyFail From 35f45c14b5f9124b15f94858b6b3cdecd77d33c6 Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Thu, 10 Nov 2016 09:42:10 -0800 Subject: [PATCH 3/7] Check for error level exactly-equal-to 1 --- cibuild.cmd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cibuild.cmd b/cibuild.cmd index 98ef63adcee61..aed7f88942aca 100644 --- a/cibuild.cmd +++ b/cibuild.cmd @@ -147,14 +147,15 @@ exit /b 1 @REM Kill any instances of msbuild.exe to ensure that we never reuse nodes (e.g. if a non-roslyn CI run @REM left some floating around). +@REM An error-level of 1 means that the process was found, but could not be killed. taskkill /F /IM vbcscompiler.exe > nul -if ERRORLEVEL 1 GOTO ActuallyFail +if %ERRORLEVEL% == 1 GOTO ActuallyFail taskkill /F /IM msbuild.exe > nul -if ERRORLEVEL 1 GOTO ActuallyFail +if %ERRORLEVEL% == 1 GOTO ActuallyFail taskkill /F /IM csc.exe > nul -if ERRORLEVEL 1 GOTO ActuallyFail +if %ERRORLEVEL% == 1 GOTO ActuallyFail taskkill /F /IM vbc.exe > nul -if ERRORLEVEL 1 GOTO ActuallyFail +if %ERRORLEVEL% == 1 GOTO ActuallyFail From 6b84bccfc5d6aaece537d2f709dd387cd6563405 Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Fri, 11 Nov 2016 09:33:03 -0800 Subject: [PATCH 4/7] change strategy --- cibuild.cmd | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cibuild.cmd b/cibuild.cmd index 98ef63adcee61..c84a92c065686 100644 --- a/cibuild.cmd +++ b/cibuild.cmd @@ -105,7 +105,7 @@ if defined TestPerfRun ( ) ) - call :TerminateBuildProcesses + call :TerminateBuildProcesses || goto :BuildFailed .\Binaries\%BuildConfiguration%\Exes\Perf.Runner\Roslyn.Test.Performance.Runner.exe --no-trace-upload !EXTRA_PERF_RUNNER_ARGS! || goto :BuildFailed exit /b 0 ) @@ -138,7 +138,6 @@ exit /b 0 :BuildFailed echo Build failed with ERRORLEVEL %ERRORLEVEL% call :TerminateBuildProcesses -:ActuallyFail exit /b 1 :TerminateBuildProcesses @@ -148,13 +147,15 @@ exit /b 1 @REM left some floating around). taskkill /F /IM vbcscompiler.exe > nul -if ERRORLEVEL 1 GOTO ActuallyFail +if ERRORLEVEL 1 exit /b 1 taskkill /F /IM msbuild.exe > nul -if ERRORLEVEL 1 GOTO ActuallyFail +if ERRORLEVEL 1 exit /b 1 taskkill /F /IM csc.exe > nul -if ERRORLEVEL 1 GOTO ActuallyFail +if ERRORLEVEL 1 exit /b 1 taskkill /F /IM vbc.exe > nul -if ERRORLEVEL 1 GOTO ActuallyFail +if ERRORLEVEL 1 exit /b 1 + +exit /b 0 From 36fd70024cb3f83f09cf10543bec83b5a05cb16a Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Fri, 11 Nov 2016 09:47:36 -0800 Subject: [PATCH 5/7] remove killing csc and vbc --- cibuild.cmd | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cibuild.cmd b/cibuild.cmd index 44df69546a9b9..ec9b1a13c1d17 100644 --- a/cibuild.cmd +++ b/cibuild.cmd @@ -153,10 +153,4 @@ if %ERRORLEVEL% == 1 exit /b 1 taskkill /F /IM msbuild.exe > nul if %ERRORLEVEL% == 1 exit /b 1 -taskkill /F /IM csc.exe > nul -if %ERRORLEVEL% == 1 exit /b 1 - -taskkill /F /IM vbc.exe > nul -if %ERRORLEVEL% == 1 exit /b 1 - exit /b 0 From 488d3655f75a1a8afa3fad7953220d5495ded47e Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Fri, 11 Nov 2016 11:17:11 -0800 Subject: [PATCH 6/7] add perf proc-kill message --- cibuild.cmd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cibuild.cmd b/cibuild.cmd index ec9b1a13c1d17..d37f5cf1c687a 100644 --- a/cibuild.cmd +++ b/cibuild.cmd @@ -105,7 +105,9 @@ if defined TestPerfRun ( ) ) + echo Killing build processes because they take up CPU which would hurt perf call :TerminateBuildProcesses || goto :BuildFailed + .\Binaries\%BuildConfiguration%\Exes\Perf.Runner\Roslyn.Test.Performance.Runner.exe --no-trace-upload !EXTRA_PERF_RUNNER_ARGS! || goto :BuildFailed exit /b 0 ) @@ -147,10 +149,10 @@ exit /b 1 @REM left some floating around). @REM An error-level of 1 means that the process was found, but could not be killed. -taskkill /F /IM vbcscompiler.exe > nul +taskkill /F /IM msbuild.exe > nul if %ERRORLEVEL% == 1 exit /b 1 -taskkill /F /IM msbuild.exe > nul +taskkill /F /IM vbcscompiler.exe > nul if %ERRORLEVEL% == 1 exit /b 1 exit /b 0 From 7f248176e26d5dfb30c9d83e81dcbb4ddb04650f Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Fri, 11 Nov 2016 11:20:09 -0800 Subject: [PATCH 7/7] change perf proc-kill message --- cibuild.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cibuild.cmd b/cibuild.cmd index d37f5cf1c687a..99465a1a4cb2c 100644 --- a/cibuild.cmd +++ b/cibuild.cmd @@ -105,7 +105,6 @@ if defined TestPerfRun ( ) ) - echo Killing build processes because they take up CPU which would hurt perf call :TerminateBuildProcesses || goto :BuildFailed .\Binaries\%BuildConfiguration%\Exes\Perf.Runner\Roslyn.Test.Performance.Runner.exe --no-trace-upload !EXTRA_PERF_RUNNER_ARGS! || goto :BuildFailed @@ -149,6 +148,7 @@ exit /b 1 @REM left some floating around). @REM An error-level of 1 means that the process was found, but could not be killed. +echo Killing all build-related processes taskkill /F /IM msbuild.exe > nul if %ERRORLEVEL% == 1 exit /b 1