diff --git a/airbyte-integrations/connectors/destination-snowflake/gradle.properties b/airbyte-integrations/connectors/destination-snowflake/gradle.properties new file mode 100644 index 000000000000..970d64da6760 --- /dev/null +++ b/airbyte-integrations/connectors/destination-snowflake/gradle.properties @@ -0,0 +1 @@ +numberThreads=2 diff --git a/build.gradle b/build.gradle index 92b6795eab0c..4804f904ac9f 100644 --- a/build.gradle +++ b/build.gradle @@ -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 { @@ -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 diff --git a/buildSrc/src/main/groovy/airbyte-integration-test-java.gradle b/buildSrc/src/main/groovy/airbyte-integration-test-java.gradle index 12562719749c..1dd892875bb9 100644 --- a/buildSrc/src/main/groovy/airbyte-integration-test-java.gradle +++ b/buildSrc/src/main/groovy/airbyte-integration-test-java.gradle @@ -45,8 +45,11 @@ class AirbyteIntegrationTestJavaPlugin implements Plugin { 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"] diff --git a/buildSrc/src/main/groovy/airbyte-performance-test-java.gradle b/buildSrc/src/main/groovy/airbyte-performance-test-java.gradle index 3bb163373668..38e8ab20fbdf 100644 --- a/buildSrc/src/main/groovy/airbyte-performance-test-java.gradle +++ b/buildSrc/src/main/groovy/airbyte-performance-test-java.gradle @@ -22,7 +22,7 @@ class AirbytePerformanceTestJavaPlugin implements Plugin { } 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")