summaryrefslogtreecommitdiff
path: root/tests/runtest.cmd
diff options
context:
space:
mode:
authorPat Gavlin <pagavlin@microsoft.com>2017-03-15 17:28:42 -0700
committerPat Gavlin <pagavlin@microsoft.com>2017-03-16 10:03:12 -0700
commit6f30002fc917cdacd4d0565f05ded920ab17f830 (patch)
tree86e40cddd1e7f3b61f56d5d48fe232753738533c /tests/runtest.cmd
parent1af419659034d9297b95240e889e4571ccefa710 (diff)
downloadcoreclr-6f30002fc917cdacd4d0565f05ded920ab17f830.tar.gz
coreclr-6f30002fc917cdacd4d0565f05ded920ab17f830.tar.bz2
coreclr-6f30002fc917cdacd4d0565f05ded920ab17f830.zip
Take crash dumps for timed-out tests.
This change updates the test infrastructure to collect crash dumps for tests that time out. We've been seeing a number of tests that only time out in CI (e.g. #10076); hopefully this will help us root-cause the timeouts.
Diffstat (limited to 'tests/runtest.cmd')
-rw-r--r--tests/runtest.cmd23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/runtest.cmd b/tests/runtest.cmd
index 89e2571da5..d112455b76 100644
--- a/tests/runtest.cmd
+++ b/tests/runtest.cmd
@@ -44,6 +44,7 @@ set __LongGCTests=
set __GCSimulatorTests=
set __AgainstPackages=
set __JitDisasm=
+set __CollectDumps=
:Arg_Loop
if "%1" == "" goto ArgsDone
@@ -84,6 +85,7 @@ if /i "%1" == "link" (set DoLink=true&set ILLINK=%2&shift&shift
REM change it to COMPlus_GCStress when we stop using xunit harness
if /i "%1" == "gcstresslevel" (set __GCSTRESSLEVEL=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
+if /i "%1" == "collectdumps" (set __CollectDumps=true&shift&goto Arg_Loop)
if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs
:: All the rest of the args will be collected and passed directly to msbuild.
@@ -207,12 +209,33 @@ if not exist %XunitTestBinBase% (
echo %__MsgPrefix%Run "buildtest.cmd %__BuildArch% %__BuildType%" to build the tests first.
exit /b 1
)
+
+if "%__CollectDumps%"=="true" (
+ :: Install dumpling
+ set "__DumplingHelperPath=%__ProjectDir%\..\Tools\DumplingHelper.py"
+ python "!__DumplingHelperPath!" install_dumpling
+
+ :: Create the crash dump folder if necessary
+ set "__CrashDumpFolder=%tmp%\CoreCLRTestCrashDumps"
+ if not exist "!__CrashDumpFolder!" (
+ mkdir "!__CrashDumpFolder!"
+ )
+
+ :: Grab the current time before execution begins. This will be used to determine which crash dumps
+ :: will be uploaded.
+ for /f "delims=" %%a in ('python !__DumplingHelperPath! get_timestamp') do @set __StartTime=%%a
+)
+
echo %__MsgPrefix%CORE_ROOT that will be used is: %CORE_ROOT%
echo %__MsgPrefix%Starting the test run ...
set __BuildLogRootName=TestRunResults
call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:Runtests=true /clp:showcommandline
+if "%__CollectDumps%"=="true" (
+ python "%__DumplingHelperPath%" collect_dump %errorlevel% "%__CrashDumpFolder%" %__StartTime% "CoreCLR_Tests"
+)
+
if errorlevel 1 (
echo Test Run failed. Refer to the following:
echo Html report: %__TestRunHtmlLog%