Skip to content

Commit 8671f04

Browse files
authored
Reduce number of cores/threads. (#910)
* Reduce number of cores/threads. On a modern mac machine with 10+ cores this demands too many workers. Gradle integration tests are disk bound no I/O bound so this doesn't speed up the build but significantly increases memory consumption. * Fix spotless
1 parent f23bd04 commit 8671f04

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

plugin-build/build.gradle.kts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ tasks.named("pluginUnderTestMetadata").configure {
133133
(this as PluginUnderTestMetadata).pluginClasspath.from(fixtureClasspath)
134134
}
135135

136-
tasks.named("test").configure {
137-
require(this is Test)
138-
maxParallelForks = Runtime.getRuntime().availableProcessors() / 2
136+
tasks.withType<Test>().named("test").configure {
137+
maxParallelForks = 2
139138

140139
// Cap JVM args per test
141140
minHeapSize = "128m"
@@ -149,10 +148,9 @@ tasks.register<Test>("integrationTest").configure {
149148
description = "Runs the integration tests"
150149
// for some reason Gradle > 8.10 doesn't pick up the pluginUnderTestMetadata classpath, so we
151150
// need to add it manually
152-
classpath +=
153-
layout.files(project.layout.buildDirectory.get().toString() + "/pluginUnderTestMetadata")
151+
classpath += layout.files(project.layout.buildDirectory.dir("pluginUnderTestMetadata"))
154152

155-
maxParallelForks = Runtime.getRuntime().availableProcessors() / 2
153+
maxParallelForks = 2
156154

157155
// Cap JVM args per test
158156
minHeapSize = "128m"
@@ -196,7 +194,7 @@ tasks.withType<Jar>().configureEach {
196194

197195
tasks.withType<ShadowJar>().configureEach {
198196
archiveClassifier.set("")
199-
configurations = listOf(project.configurations.getByName("shade"))
197+
configurations = listOf(shade)
200198

201199
exclude("/kotlin/**")
202200
exclude("/groovy**")

0 commit comments

Comments
 (0)