Skip to content

Commit 30a0932

Browse files
authored
Add a GC Reliability Framework job to the CI (dotnet#11280)
* Add GC Reliability Framework CI job * Three changes: 1) To address offline feedback, update the CI trigger phase document and the GC testing instructions 2) Set the timeout for GC RF CI jobs to 24 hours, so they don't time out (they will run for 15 hours by default) 3) Refactor "scenario == 'gc_reliability_framework' to its own method so that new GC RF scenarios can easily and cleanly be added if desired in the future
1 parent 624378e commit 30a0932

File tree

6 files changed

+133
-7
lines changed

6 files changed

+133
-7
lines changed

Documentation/project-docs/ci-trigger-phrases.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ To trigger a job, post a comment on your PR with "@dotnet-bot {trigger-phrase}".
1111

1212
- **Windows_NT x64 Release Priority 1 Build & Test:** "test Windows_NT pri1"
1313
- **Windows_NT x64 Release IL RoundTrip Build & Test:** "test Windows_NT ilrt"
14-
- **Windows_NT x64 Release Long-Running GC Build & Test:**: "test Windows_NT x64 Release longgc"
14+
- **Windows_NT x64 Release Long-Running GC Build & Test:**: "test Windows_NT Release longgc"
15+
- **Windows_NT x64 Release GC Simulator:**: "test Windows_NT Release gcsimulator"
16+
- **Windows_NT x64 Release Standalone GC:**: "test Windows_NT Release standalone_gc"
17+
- **Windows_NT x64 Release GC Reliability Framework:**: "test Windows_NT Release gc_reliability_framework"
1518
- **Windows_NT x64 Release Ready-To-Run Priority 0 Build & Test:** "test Windows_NT Release r2r"
1619
- **Windows_NT x64 Checked Ready-To-Run Priority 0 Build & Test:** "test Windows_NT Checked r2r"
1720
- **Windows_NT x64 Release Ready-To-Run Priority 1 Build & Test:** "test Windows_NT Release pri1r2r"
@@ -69,6 +72,8 @@ To trigger a job, post a comment on your PR with "@dotnet-bot {trigger-phrase}".
6972
- **Windows_NT x64 Checked GCStress=0xc JitStress=2 Build & Test:** "test Windows_NT gcstress0xc_jitstress2"
7073
- **Windows_NT x64 Checked GCStress=0xc MinOpts Heap Verify 1 Build & Test:** "test Windows_NT gcstress0xc_minopts_heapverify1"
7174
- **Windows_NT x64 Checked Long-Running GC Build & Test:**: "test Windows_NT x64 Checked longgc"
75+
- **Windows_NT x64 Checked Standalone GC:**: "test Windows_NT Checked standalone_gc"
76+
- **Windows_NT x64 Checked GC Reliability Framework:**: "test Windows_NT Checked gc_reliability_framework"
7277
- **Windows_NT x64 Formatting:**: "test Windows_NT formatting"
7378
- **Windows_NT x64 Checked CoreFX Baseline Build & Test:** "test Windows_NT corefx_baseline"
7479
- **Windows_NT x64 Checked CoreFX MinOpts Build & Test:** "test Windows_NT corefx_minopts"
@@ -166,6 +171,11 @@ To trigger a job, post a comment on your PR with "@dotnet-bot {trigger-phrase}".
166171
- **Ubuntu x64 Release Priority 1 Build & Test:** "test Ubuntu pri1"
167172
- **Ubuntu x64 Release IL RoundTrip Build & Test:** "test Ubuntu ilrt"
168173
- **Ubuntu x64 Release Long-Running GC Build & Test:**: "test Ubuntu Release longgc"
174+
- **Ubuntu x64 Release GC Simulator:**: "test Ubuntu Release gcsimulator"
175+
- **Ubuntu x64 Release Standalone GC:**: "test Ubuntu Release standalone_gc"
176+
- **Ubuntu x64 Checked Standalone GC:**: "test Ubuntu Checked standalone_gc"
177+
- **Ubuntu x64 Release GC Reliability Framework:**: "test Ubuntu Release gc_reliability_framework"
178+
- **Ubuntu x64 Checked GC Reliability Framework:**: "test Ubuntu Checked gc_reliability_framework"
169179
- **Ubuntu x64 Release Ready-To-Run Priority 0 Build & Test:** "test Ubuntu Release r2r"
170180
- **Ubuntu x64 Checked Ready-To-Run Priority 0 Build & Test:** "test Ubuntu Checked r2r"
171181
- **Ubuntu x64 Release Ready-To-Run Priority 1 Build & Test:** "test Ubuntu Release pri1r2r"
@@ -248,6 +258,11 @@ To trigger a job, post a comment on your PR with "@dotnet-bot {trigger-phrase}".
248258
- **OSX x64 Release Priority 1 Build & Test:** "test OSX pri1"
249259
- **OSX x64 Release IL RoundTrip Build & Test:** "test OSX ilrt"
250260
- **OSX x64 Release Long-Running GC Build & Test:**: "test OSX Release longgc"
261+
- **OSX x64 Release GC Simulator:**: "test OSX10.12 Release gcsimulator"
262+
- **OSX x64 Release Standalone GC:**: "test OSX10.12 Release standalone_gc"
263+
- **OSX x64 Checked Standalone GC:**: "test OSX10.12 Checked standalone_gc"
264+
- **OSX x64 Release GC Reliability Framework:**: "test OSX10.12 Release gc_reliability_framework"
265+
- **OSX x64 Checked GC Reliability Framework:**: "test OSX10.12 Checked gc_reliability_framework"
251266
- **OSX x64 Release Ready-To-Run Priority 0 Build & Test:** "test OSX Release r2r"
252267
- **OSX x64 Checked Ready-To-Run Priority 0 Build & Test:** "test OSX Checked r2r"
253268
- **OSX x64 Release Ready-To-Run Priority 1 Build & Test:** "test OSX Release pri1r2r"

Documentation/project-docs/garbage-collector-guidelines.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,43 @@ Required Testing: Validation of the behavior of the affected APIs.
2626
## Stress Testing ##
2727
Stress testing must run for at least **48 hours** against a debug build.
2828

29-
Instructions for running stress are located in the repo at tests\src\GC\Stress\stress_run_readme.txt.
29+
Stress testing for checked and release builds can be done on pull requests with The .NET CI infrastructure.
30+
A stress run can be requested using the trigger phrase:
31+
32+
```
33+
@dotnet_bot test <platform> <flavor> gc_reliability_framework
34+
```
35+
36+
This will run the stress framework for the default amount of time (15 hours) on the given platform and build flavor.
3037

3138
## Functional Testing ##
3239
A functional test run executes the same code as a stress run, but only runs for 30 minutes.
3340

3441
Instructions for running stress are located in the repo at tests\src\GC\Stress\stress_run_readme.txt.
3542

43+
It is recommended that you run at least some of the below PR-triggered CI jobs:
44+
45+
```
46+
@dotnet_bot test Windows_NT Checked longgc
47+
@dotnet_bot test OSX10.12 Checked longgc
48+
@dotnet_bot test Ubuntu Checked longgc
49+
@dotnet_bot test Windows_NT Checked standalone_gc
50+
@dotnet_bot test OSX10.12 Checked standalone_gc
51+
@dotnet_bot test Ubuntu Checked standalone_gc
52+
```
53+
54+
The "Long GC" tests are a series of GC tests whose running time is too long or memory usage is too high to run with
55+
the rest of the Priority 0 unit tests. The "Standalone GC" build mode builds and runs the GC in a semi-standalone manner
56+
(see https://github.com/dotnet/coreclr/projects/3).
57+
58+
You may also wish to run the GC Simulator tests. They may take up to 24 hours to complete and are known to sometimes fail on Ubuntu
59+
due to poor interactions with the Linux OOM killer. However, they have proven to be quite useful in finding bugs in the past:
60+
61+
```
62+
@dotnet_bot test Windows_NT Release gcsimulator
63+
@dotnet_bot test Ubuntu Release gcsimulator
64+
@dotnet_bot test OSX10.12 Release gcsimulator
65+
```
66+
3667
## Performance Testing ##
3768
Coming soon.

netci.groovy

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class Constants {
137137
'gcsimulator',
138138
'jitdiff',
139139
'standalone_gc',
140+
'gc_reliability_framework',
140141
'illink'] + r2rJitStressScenarios
141142

142143
def static configurationList = ['Debug', 'Checked', 'Release']
@@ -205,6 +206,14 @@ def static isJitDiff(def scenario) {
205206
return (scenario == 'jitdiff')
206207
}
207208

209+
def static isGcReliabilityFramework(def scenario) {
210+
return (scenario == 'gc_reliability_framework')
211+
}
212+
213+
def static scenarioNeedsPri1Build(def scenario) {
214+
return (scenario == 'pri1' || scenario == 'pri1r2r' || scenario == 'gcstress15_pri1r2r'|| scenario == 'coverage' || isGcReliabilityFramework(scenario))
215+
}
216+
208217
def static setTestJobTimeOut(newJob, scenario) {
209218
if (isGCStressRelatedTesting(scenario)) {
210219
Utilities.setJobTimeout(newJob, 4320)
@@ -227,6 +236,9 @@ def static setTestJobTimeOut(newJob, scenario) {
227236
else if (isJitDiff(scenario)) {
228237
Utilities.setJobTimeout(newJob, 240)
229238
}
239+
else if (isGcReliabilityFramework(scenario)) {
240+
Utilities.setJobTimeout(newJob, 1440)
241+
}
230242
// Non-test jobs use the default timeout value.
231243
}
232244

@@ -497,6 +509,11 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
497509
// addEmailPublisher(job, '[email protected]')
498510
Utilities.addPeriodicTrigger(job, '@weekly')
499511
break
512+
case 'gc_reliability_framework':
513+
assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
514+
assert (configuration == 'Release' || configuration == 'Checked')
515+
// Only triggered by phrase.
516+
break
500517
case 'ilrt':
501518
assert !(os in bidailyCrossList)
502519
// ILASM/ILDASM roundtrip one gets a daily build, and only for release
@@ -766,6 +783,16 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
766783
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
767784
}
768785
break
786+
case 'standalone_gc':
787+
if (configuration == 'Release' || configuration == 'Checked') {
788+
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
789+
}
790+
break
791+
case 'gc_reliability_framework':
792+
if (configuration == 'Release' || configuration == 'Checked') {
793+
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
794+
}
795+
break
769796
case 'minopts':
770797
case 'forcerelocs':
771798
case 'jitstress1':
@@ -939,6 +966,11 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
939966
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
940967
}
941968
break
969+
case 'gc_reliability_framework':
970+
if (configuration == 'Release' || configuration == 'Checked') {
971+
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
972+
}
973+
break
942974
case 'minopts':
943975
case 'forcerelocs':
944976
case 'jitstress1':
@@ -1307,7 +1339,7 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
13071339
// binaries are sent to a default directory whose name is about
13081340
// 35 characters long.
13091341

1310-
else if (scenario == 'pri1' || scenario == 'pri1r2r' || scenario == 'gcstress15_pri1r2r'|| scenario == 'coverage') {
1342+
else if (scenarioNeedsPri1Build(scenario)) {
13111343
buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts} -priority=1"
13121344
}
13131345
else if (isLongGc(scenario)) {
@@ -1435,6 +1467,12 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
14351467
buildCommands += "%WORKSPACE%\\tests\\runtest.cmd ${runtestArguments} TestEnv ${stepScriptLocation}"
14361468
}
14371469
}
1470+
else if (isGcReliabilityFramework(scenario)) {
1471+
buildCommands += "tests\\runtest.cmd ${runtestArguments} GenerateLayoutOnly"
1472+
buildCommands += "tests\\scripts\\run-gc-reliability-framework.cmd ${arch} ${configuration}"
1473+
Utilities.addArchival(newJob, "stdout.txt")
1474+
Utilities.addArchival(newJob, "Logs/**")
1475+
}
14381476
else if (architecture == 'x64' || architecture == 'x86') {
14391477
buildCommands += "tests\\runtest.cmd ${runtestArguments}"
14401478
}
@@ -1870,6 +1908,7 @@ combinedScenarios.each { scenario ->
18701908
return
18711909
}
18721910
break
1911+
case 'gc_reliability_framework':
18731912
case 'standalone_gc':
18741913
if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
18751914
return
@@ -2120,10 +2159,12 @@ combinedScenarios.each { scenario ->
21202159
return
21212160
}
21222161
break
2162+
case 'gc_reliability_framework':
21232163
case 'standalone_gc':
21242164
if (configuration != 'Release' && configuration != 'Checked') {
21252165
return
21262166
}
2167+
break
21272168
case 'coverage':
21282169
//We only want Ubuntu Release for coverage
21292170
if (os != 'Ubuntu') {
@@ -2164,7 +2205,7 @@ combinedScenarios.each { scenario ->
21642205
// so we didn't create a build only job for windows_nt specific to that stress mode. Just copy
21652206
// from the default scenario
21662207
def testBuildScenario = scenario
2167-
if (testBuildScenario == 'coverage' || testBuildScenario == 'pri1r2r'|| testBuildScenario == 'gcstress15_pri1r2r') {
2208+
if (scenarioNeedsPri1Build(scenario)) {
21682209
testBuildScenario = 'pri1'
21692210
}
21702211
else if ( testBuildScenario == 'r2r' || Constants.r2rJitStressScenarios.indexOf(testBuildScenario) != -1 || isLongGc(testBuildScenario)) {
@@ -2210,6 +2251,7 @@ combinedScenarios.each { scenario ->
22102251
def runilasmroundtripStr = ''
22112252
def gcstressStr = ''
22122253
def illinkStr = ''
2254+
def layoutOnlyStr =''
22132255

22142256
if (scenario == 'r2r' ||
22152257
scenario == 'pri1r2r' ||
@@ -2286,6 +2328,10 @@ combinedScenarios.each { scenario ->
22862328
}
22872329
}
22882330

2331+
if (isGcReliabilityFramework(scenario)) {
2332+
layoutOnlyStr = '--build-overlay-only'
2333+
}
2334+
22892335
def folder = getJobFolder(scenario)
22902336
def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folder)) {
22912337
// Add parameters for the inputs
@@ -2438,11 +2484,29 @@ combinedScenarios.each { scenario ->
24382484
--mscorlibDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
24392485
--coreFxBinDir=\"\${WORKSPACE}/bin/CoreFxBinDir\" \\
24402486
--limitedDumpGeneration \\
2441-
${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${runilasmroundtripStr} ${illinkStr} ${sequentialString} ${playlistString}""")
2487+
${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} \\
2488+
${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${runilasmroundtripStr} \\
2489+
${illinkStr} ${sequentialString} ${playlistString} ${layoutOnlyStr}""")
2490+
2491+
if (isGcReliabilityFramework(scenario)) {
2492+
// runtest.sh doesn't actually execute the reliability framework - do it here.
2493+
if (serverGCString != '') {
2494+
shell("export COMPlus_gcServer=1")
2495+
}
2496+
2497+
shell("./tests/scripts/run-gc-reliability-framework.sh ${architecture} ${configuration}")
2498+
}
24422499
}
24432500
}
24442501
}
24452502

2503+
if (isGcReliabilityFramework(scenario))
2504+
{
2505+
// Both of these are emitted by the RF
2506+
Utilities.addArchival(newJob, "stdout.txt")
2507+
Utilities.addArchival(newJob, "Logs/**")
2508+
}
2509+
24462510
if (scenario == 'coverage') {
24472511
// Publish coverage reports
24482512
Utilities.addHtmlPublisher(newJob, '${WORKSPACE}/coverage/Coverage/reports', 'Code Coverage Report', 'coreclr.html')
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@rem Licensed to the .NET Foundation under one or more agreements.
2+
@rem The .NET Foundation licenses this file to you under the MIT license.
3+
@rem See the LICENSE file in the project root for more information.
4+
5+
@echo off
6+
7+
set CORE_ROOT=%CD%\bin\tests\Windows_NT.%1.%2\Tests\Core_Root
8+
set FRAMEWORK_DIR=%CD%\bin\tests\Windows_NT.%1.%2\GC\Stress\Framework\ReliabilityFramework
9+
powershell "%CORE_ROOT%\CoreRun.exe %FRAMEWORK_DIR%\ReliabilityFramework.exe %FRAMEWORK_DIR%\testmix_gc.config | tee stdout.txt"
10+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
export CORE_ROOT=`pwd`/bin/tests/Windows_NT.$1.$2/Tests/coreoverlay
4+
FRAMEWORK_DIR=`pwd`/bin/tests/Windows_NT.$1.$2/GC/Stress/Framework/ReliabilityFramework
5+
$CORE_ROOT/corerun $FRAMEWORK_DIR/ReliabilityFramework.exe $FRAMEWORK_DIR/testmix_gc.config | tee stdout.txt
6+

tests/src/GC/Stress/Framework/ReliabilityFramework.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<OutputType>Exe</OutputType>
1111
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1212
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
13-
<CLRTestKind>BuildAndRun</CLRTestKind>
13+
<CLRTestKind>BuildOnly</CLRTestKind>
14+
<GenerateRunScript>false</GenerateRunScript>
1415
<CLRTestPriority>1</CLRTestPriority>
15-
<CLRTestExecutionArguments>testmix_gc.config /maximumExecutionTime:-1</CLRTestExecutionArguments>
1616
<DefineConstants>$(DefineConstants);STATIC;PROJECTK_BUILD</DefineConstants>
1717
</PropertyGroup>
1818
<!-- Default configurations to help VS understand the configurations -->

0 commit comments

Comments
 (0)