mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
build scripts: export OOM heap dump as a build artifact
Also use a special name for it to make it easier to download.
This commit is contained in:
@@ -31,6 +31,8 @@ abstract class TestingTasks {
|
||||
*/
|
||||
abstract void runTests(List<String> additionalJvmOptions, String defaultMainModule, Predicate<File> rootExcludeCondition)
|
||||
|
||||
abstract File createSnapshotsDirectory()
|
||||
|
||||
static TestingTasks create(CompilationContext context, TestingOptions options = new TestingOptions()) {
|
||||
return new TestingTasksImpl(context, options)
|
||||
}
|
||||
|
||||
+16
@@ -60,11 +60,14 @@ class TestingTasksImpl extends TestingTasks {
|
||||
FileUtilRt.createParentDirs(classpathFile)
|
||||
classpathFile.text = testsClasspath.findAll({ new File(it).exists() }).join('\n')
|
||||
|
||||
File snapshotsDir = createSnapshotsDirectory()
|
||||
String hprofSnapshotFilePath = new File(snapshotsDir, "intellij-tests-oom.hprof").absolutePath
|
||||
List<String> jvmArgs = [
|
||||
"-ea",
|
||||
"-server",
|
||||
"-Xbootclasspath/a:${context.getModuleOutputPath(context.findRequiredModule("boot"))}".toString(),
|
||||
"-XX:+HeapDumpOnOutOfMemoryError",
|
||||
"-XX:HeapDumpPath=$hprofSnapshotFilePath".toString(),
|
||||
"-XX:ReservedCodeCacheSize=300m",
|
||||
"-XX:SoftRefLRUPolicyMSPerMB=50",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
@@ -192,6 +195,19 @@ class TestingTasksImpl extends TestingTasks {
|
||||
else
|
||||
//run other suites instead of BootstrapTests
|
||||
runJUnitTask(jvmArgs, systemProperties, testsClasspath)
|
||||
|
||||
if (new File(hprofSnapshotFilePath).exists()) {
|
||||
context.notifyArtifactBuilt(hprofSnapshotFilePath)
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@CompileDynamic
|
||||
File createSnapshotsDirectory() {
|
||||
File snapshotsDir = new File("$context.paths.projectHome/out/snapshots")
|
||||
context.ant.delete(dir: snapshotsDir)
|
||||
context.ant.mkdir(dir: snapshotsDir)
|
||||
return snapshotsDir
|
||||
}
|
||||
|
||||
@CompileDynamic
|
||||
|
||||
Reference in New Issue
Block a user