Crossgen2 composite GC stress pipeline (#39949)
authorTomáš Rylek <trylek@microsoft.com>
Wed, 29 Jul 2020 17:37:59 +0000 (19:37 +0200)
committerGitHub <noreply@github.com>
Wed, 29 Jul 2020 17:37:59 +0000 (19:37 +0200)
eng/pipelines/coreclr/crossgen2-gcstress.yml [new file with mode: 0644]
src/coreclr/tests/src/CLRTest.CrossGen.targets

diff --git a/eng/pipelines/coreclr/crossgen2-gcstress.yml b/eng/pipelines/coreclr/crossgen2-gcstress.yml
new file mode 100644 (file)
index 0000000..7942e74
--- /dev/null
@@ -0,0 +1,60 @@
+trigger: none
+
+pr: none
+
+schedules:
+- cron: "0 6 * * 0,1"
+  displayName: Sat and Sun at 10:00 PM (UTC-8:00)
+  branches:
+    include:
+    - master
+  always: true
+
+jobs:
+#
+# Checkout repository
+#
+- template: /eng/pipelines/common/checkout-job.yml
+
+- template: /eng/pipelines/common/platform-matrix.yml
+  parameters:
+    jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml
+    buildConfig: checked
+    platforms:
+    - Linux_x64
+    - Linux_arm64
+    - OSX_x64
+    - Windows_NT_x64
+    - Windows_NT_arm64
+    - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
+    jobParameters:
+      testGroup: gcstress-extra
+
+- template: /eng/pipelines/common/platform-matrix.yml
+  parameters:
+    jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml
+    buildConfig: checked
+    platforms:
+    - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
+    jobParameters:
+      testGroup: gcstress-extra
+      liveLibrariesBuildConfig: Release
+
+- template: /eng/pipelines/common/platform-matrix.yml
+  parameters:
+    jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
+    helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
+    buildConfig: checked
+    platforms:
+    - Linux_x64
+    - Linux_arm64
+    - OSX_x64
+    - Windows_NT_x64
+    - Windows_NT_arm64
+    jobParameters:
+      testGroup: gcstress-extra
+      readyToRun: true
+      crossgen2: true
+      compositeBuildMode: true
+      displayNameArgs: Composite
+      liveLibrariesBuildConfig: Release
index a110437..926f6ec 100644 (file)
@@ -84,6 +84,14 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then
       __ResponseFile="$__OutputFile.rsp"
       rm $__ResponseFile
 
+      // Suppress the GC stress COMPlus for the duration of Crossgen2 execution
+      local gcStressModeToRestore = $COMPlus_GCStress;
+      local heapVerifyModeToRestore = $COMPlus_HeapVerify;
+      local readyToRunModeToRestore = $COMPlus_ReadyToRun;
+      export COMPlus_GCStress=
+      export COMPlus_HeapVerify=
+      export COMPlus_ReadyToRun=
+
       __Command=$_DebuggerFullPath
       # Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path
       if [ ! -z ${__TestDotNetCmd+x} ] %3B then
@@ -109,6 +117,10 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then
       echo "Running CrossGen2: $__Command"
       $__Command
       __cg2ExitCode=$?
+
+      export COMPlus_GCStress=$gcStressModeToRestore
+      export COMPlus_HeapVerify=$heapVerifyModeToRestore
+      export COMPlus_ReadyToRun=$readyToRunModeToRestore
   }
 
     if [ ! -z ${CompositeBuildMode+x} ]%3B then
@@ -212,6 +224,14 @@ if defined RunCrossGen2 (
     set __ResponseFile=!__OutputFile!.rsp
     del /Q !__ResponseFile!
 
+    REM Suppress GC stress mode for the duration of Crossgen2 execution
+    set __gcStressModeToRestore=!COMPlus_GCStress!
+    set COMPlus_GCStress=
+    set __heapVerifyModeToRestore=!COMPlus_HeapVerify!
+    set COMPlus_HeapVerify=
+    set __readyToRunModeToRestore=!COMPlus_ReadyToRun!
+    set COMPlus_ReadyToRun=
+
     set __Command=!_DebuggerFullPath!
     REM Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path
     if defined __TestDotNetCmd (
@@ -237,6 +257,10 @@ if defined RunCrossGen2 (
     echo "!__Command!"
     call !__Command!
     set CrossGen2Status=!ERRORLEVEL!
+    set COMPlus_GCStress=!__gcStressModeToRestore!
+    set COMPlus_HeapVerify=!__heapVerifyModeToRestore!
+    set COMPlus_ReadyToRun=!__readyToRunModeToRestore!
+
     Exit /b 0
 
 :DoneCrossgen2Operations