Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property to limit test parallelisation #23870

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
numberThreads=2
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ subprojects { subproj ->
// make tag accessible in submodules.
ext {
cloudStorageTestTagName = 'cloud-storage'
numberThreads = project.hasProperty('numberThreads') ? project.getProperty('numberThreads') : Runtime.runtime.availableProcessors() ?: 1
}

spotbugs {
Expand All @@ -354,7 +355,9 @@ subprojects { subproj ->
}

test {
maxParallelForks = Runtime.runtime.availableProcessors() ?: 1
//This allows to set up a `gradle.properties` file inside the connector folder to reduce number of threads and reduce parallelization.
//Specially useful for connectors that shares resources (like Redshift or Snowflake).
maxParallelForks = numberThreads

jacoco {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ class AirbyteIntegrationTestJavaPlugin implements Plugin<Project> {
dependsOn project.airbyteDocker
}

//This allows to set up a `gradle.properties` file inside the connector folder to reduce number of threads and reduce parallelization.
//Specially useful for connectors that shares resources (like Redshift or Snowflake).
ext.numberThreads = project.hasProperty('numberThreads') ? project.getProperty('numberThreads') : Runtime.runtime.availableProcessors() ?: 1
maxHeapSize = '3g'
maxParallelForks = Runtime.runtime.availableProcessors() ?: 1
maxParallelForks = numberThreads

// This is needed to make the destination-snowflake tests succeed - https://github.com/snowflakedb/snowflake-jdbc/issues/589#issuecomment-983944767
jvmArgs = ["--add-opens=java.base/java.nio=ALL-UNNAMED"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AirbytePerformanceTestJavaPlugin implements Plugin<Project> {
}

project.task('performanceTestJava', type: Test) {
testClassesDirs += project.sourceSets.performanceTestJava.output.classesDirs
testClassesDirs = project.sourceSets.performanceTestJava.output.classesDirs
classpath += project.sourceSets.performanceTestJava.runtimeClasspath

systemProperty "cpuLimit", System.getProperty("cpuLimit")
Expand Down