Skip to content

Commit bf4d46e

Browse files
committed
Disable parallel testing for DB2 11.5
1 parent 4561943 commit bf4d46e

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

hibernate-core/hibernate-core.gradle

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,14 @@ tasks.withType( Test.class ).each { test ->
274274
// Most systems have multi-threading and maxing out a core on both threads will hurt performance
275275
// Also, as soon as we hit 16+ threads, the returns are diminishing, so divide by 4
276276
def threadCount = Runtime.runtime.availableProcessors()
277-
test.maxParallelForks = threadCount >= 16 ? threadCount.intdiv( 4 ) : (threadCount.intdiv( 2 ) ?: 1)
277+
def testThreads = project.getProperties().get( "test.threads" )
278+
if ( testThreads == null ) {
279+
testThreads = threadCount >= 16 ? threadCount.intdiv( 4 ) : (threadCount.intdiv( 2 ) ?: 1)
280+
}
281+
else {
282+
testThreads = Integer.parseInt( testThreads.toString() )
283+
}
284+
test.maxParallelForks = testThreads
278285
test.systemProperty 'maxParallelForks', test.maxParallelForks
279286
}
280287
else if ( project.db == "oracle_test_pilot_database" ) {

hibernate-envers/hibernate-envers.gradle

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@ tasks.withType( Test.class ).each { test ->
6666
// Most systems have multi-threading and maxing out a core on both threads will hurt performance
6767
// Also, as soon as we hit 16+ threads, the returns are diminishing, so divide by 4
6868
def threadCount = Runtime.runtime.availableProcessors()
69-
test.maxParallelForks = threadCount >= 16 ? threadCount.intdiv( 4 ) : (threadCount.intdiv( 2 ) ?: 1)
69+
def testThreads = project.getProperties().get( "test.threads" )
70+
if ( testThreads == null ) {
71+
testThreads = threadCount >= 16 ? threadCount.intdiv( 4 ) : (threadCount.intdiv( 2 ) ?: 1)
72+
}
73+
else {
74+
testThreads = Integer.parseInt( testThreads.toString() )
75+
}
76+
test.maxParallelForks = testThreads
7077
test.systemProperty 'maxParallelForks', test.maxParallelForks
7178
}
7279
else if ( project.db == "oracle_test_pilot_database" ) {

nightly.Jenkinsfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ stage('Build') {
126126
case "db2_11_5":
127127
sh "./docker_db.sh db2_11_5"
128128
state[buildEnv.tag]['containerName'] = "db2"
129+
// The tenant feature was only added in DB2 12, so disable parallel testing
130+
state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] +
131+
" -Ptest.threads=1"
129132
break;
130133
case "mssql_2017":
131134
sh "./docker_db.sh mssql_2017"

0 commit comments

Comments
 (0)