Skip to content

Commit a3b224d

Browse files
committed
fix(test): optimize unit test with parallel mode
1 parent a8fc651 commit a3b224d

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ subprojects {
7979
}
8080
}
8181

82+
tasks.withType(JavaCompile).configureEach {
83+
options.fork = true
84+
}
85+
8286
task copyToParent(type: Copy) {
8387
into "$buildDir/libs"
8488
subprojects {

framework/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ test {
157157
forkEvery = 100
158158
jvmArgs "-XX:MetaspaceSize=128m","-XX:MaxMetaspaceSize=256m", "-XX:+UseG1GC"
159159
}
160+
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
161+
if (!project.hasProperty("createReports")) {
162+
reports.html.enabled = false
163+
reports.junitXml.enabled = false
164+
}
160165
}
161166

162167
task stest(type: Test) {

0 commit comments

Comments
 (0)