Skip to content

Commit 0593be4

Browse files
committed
Parallelize CockroachDB testing
1 parent 67970f4 commit 0593be4

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

docker_db.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,24 @@ EOF
12601260

12611261
}
12621262

1263+
cockroachdb_setup() {
1264+
databases=()
1265+
for n in $(seq 1 $DB_COUNT)
1266+
do
1267+
databases+=("hibernate_orm_test_${n}")
1268+
done
1269+
create_cmd=
1270+
for i in "${!databases[@]}";do
1271+
create_cmd+="create database ${databases[i]};"
1272+
done
1273+
$CONTAINER_CLI exec cockroach bash -c "cat <<EOF | ./cockroach sql --insecure
1274+
$create_cmd
1275+
1276+
quit
1277+
EOF
1278+
"
1279+
}
1280+
12631281
tidb() {
12641282
tidb_5_4
12651283
}

hibernate-core/hibernate-core.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ tasks.withType( Test.class ).each { test ->
270270
// see GradleParallelTestingResolver for how the test worker id is resolved in JDBC configs
271271
if ( project.db == "h2" || project.db == "hsqldb" || project.db == "pgsql_ci" || project.db == "edb_ci"
272272
|| project.db == "oracle_ci" || project.db == "oracle_xe_ci" || project.db == "mysql_ci" || project.db == "mariadb_ci"
273-
|| project.db == "db2_ci" || project.db == "mssql_ci" ) {
273+
|| project.db == "db2_ci" || project.db == "mssql_ci" || project.db == "cockroachdb" ) {
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()

hibernate-core/src/test/java/org/hibernate/orm/test/bulkid/OracleInlineMutationStrategyIdTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
*/
55
package org.hibernate.orm.test.bulkid;
66

7+
import org.hibernate.dialect.CockroachDialect;
8+
import org.hibernate.testing.orm.junit.SkipForDialect;
9+
710
/**
811
* Special test that tries to update 1100 rows. Oracle only supports up to 1000 parameters per in-predicate,
912
* so we want to test if this scenario works.
1013
*
1114
* @author Vlad Mihalcea
1215
*/
16+
@SkipForDialect(
17+
dialectClass = CockroachDialect.class,
18+
reason = "Amount of rows lengthens the transaction time, leading to retry errors on CockroachDB: https://www.cockroachlabs.com/docs/v24.3/transaction-retry-error-reference.html#retry_commit_deadline_exceeded"
19+
)
1320
public class OracleInlineMutationStrategyIdTest extends InlineMutationStrategyIdTest {
1421

1522
@Override

hibernate-envers/hibernate-envers.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ tasks.withType( Test.class ).each { test ->
6262
// see GradleParallelTestingResolver for how the test worker id is resolved in JDBC configs
6363
if ( project.db == "h2" || project.db == "hsqldb" || project.db == "pgsql_ci" || project.db == "edb_ci"
6464
|| project.db == "oracle_ci" || project.db == "oracle_xe_ci" || project.db == "mysql_ci" || project.db == "mariadb_ci"
65-
|| project.db == "db2_ci" || project.db == "mssql_ci" ) {
65+
|| project.db == "db2_ci" || project.db == "mssql_ci" || project.db == "cockroachdb" ) {
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()

local-build-plugins/src/main/groovy/local.databases.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ ext {
378378
'jdbc.user' : 'root',
379379
'jdbc.pass' : '',
380380
// Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com
381-
'jdbc.url' : 'jdbc:postgresql://' + dbHost + ':26257/defaultdb?sslmode=disable&preparedStatementCacheQueries=0&escapeSyntaxCallMode=callIfNoReturn',
381+
'jdbc.url' : 'jdbc:postgresql://' + dbHost + ':26257/hibernate_orm_test_$worker?sslmode=disable&preparedStatementCacheQueries=0&escapeSyntaxCallMode=callIfNoReturn',
382382
'jdbc.datasource' : 'org.postgresql.Driver',
383383
// 'jdbc.datasource' : 'org.postgresql.ds.PGSimpleDataSource',
384384
// Configure the for-update clause to use proper locks: https://github.com/cockroachdb/cockroach/issues/88995

0 commit comments

Comments
 (0)