Skip to content

Commit 25c0c18

Browse files
committed
[#1550] Disable tests causing IllegalStateException for Db2
See eclipse-vertx/vertx-sql-client#899 Tests throw: ``` java.util.concurrent.CompletionException: java.lang.IllegalStateException: Needed to have 6 in buffer but only had 0. In JDBC we would normally block here but need to find a non-blocking solution at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331) ~[?:?] at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346) ~[?:?] at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:632) ~[?:?] at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?] at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088) ~[?:?] at org.hibernate.reactive.pool.impl.Handlers.lambda$toCompletionStage$0(Handlers.java:29) ~[main/:?] at io.vertx.sqlclient.impl.SqlResultHandler.fail(SqlResultHandler.java:103) ```
1 parent 96bf76d commit 25c0c18

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/LazyUniqueKeyTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99

1010
import org.hibernate.annotations.Fetch;
1111
import org.hibernate.annotations.FetchMode;
12+
import org.hibernate.reactive.testing.DatabaseSelectionRule;
1213

1314
import org.junit.Ignore;
15+
import org.junit.Rule;
1416
import org.junit.Test;
1517

1618
import jakarta.persistence.CascadeType;
@@ -25,11 +27,18 @@
2527
import java.util.Collection;
2628
import java.util.List;
2729

30+
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.DB2;
31+
import static org.hibernate.reactive.testing.DatabaseSelectionRule.skipTestsFor;
32+
2833
/**
2934
* @see EagerUniqueKeyTest
3035
*/
3136
public class LazyUniqueKeyTest extends BaseReactiveTest {
3237

38+
// Db2: java.lang.IllegalStateException: Needed to have 6 in buffer but only had 0. In JDBC we would normally block here
39+
@Rule
40+
public DatabaseSelectionRule skip = skipTestsFor( DB2 );
41+
3342
@Override
3443
protected Collection<Class<?>> annotatedEntities() {
3544
return List.of( Foo.class, Bar.class );

hibernate-reactive-core/src/test/java/org/hibernate/reactive/OrderQueriesTestBase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@
1616
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
1717
import org.hibernate.cfg.Configuration;
1818
import org.hibernate.reactive.provider.Settings;
19+
import org.hibernate.reactive.testing.DatabaseSelectionRule;
1920
import org.hibernate.reactive.testing.SqlStatementTracker;
2021

2122
import org.junit.After;
23+
import org.junit.Rule;
2224
import org.junit.Test;
2325

2426
import io.smallrye.mutiny.Uni;
2527
import io.vertx.ext.unit.TestContext;
2628

2729
import static org.assertj.core.api.Assertions.assertThat;
30+
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.DB2;
31+
import static org.hibernate.reactive.testing.DatabaseSelectionRule.skipTestsFor;
2832

2933
/**
3034
* Test {@code hibernate.order_updates} and {@code hibernate.order_inserts} configurations.
@@ -34,6 +38,10 @@
3438
*/
3539
public abstract class OrderQueriesTestBase extends BaseReactiveTest {
3640

41+
//Db2: java.lang.IllegalStateException: Needed to have 6 in buffer but only had 0. In JDBC we would normally block
42+
@Rule
43+
public final DatabaseSelectionRule skip = skipTestsFor( DB2 );
44+
3745
public static class OrderUpdatesTest extends OrderQueriesTestBase {
3846

3947
@Override

hibernate-reactive-core/src/test/java/org/hibernate/reactive/OrphanRemovalTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
import java.util.Set;
1212

1313

14+
import org.hibernate.reactive.testing.DatabaseSelectionRule;
15+
16+
import org.junit.Rule;
1417
import org.junit.Test;
1518

1619
import io.vertx.ext.unit.TestContext;
@@ -24,14 +27,18 @@
2427
import static jakarta.persistence.CascadeType.PERSIST;
2528
import static jakarta.persistence.CascadeType.REMOVE;
2629
import static org.assertj.core.api.Assertions.assertThat;
30+
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.DB2;
31+
import static org.hibernate.reactive.testing.DatabaseSelectionRule.skipTestsFor;
2732

2833
public class OrphanRemovalTest extends BaseReactiveTest {
2934

35+
//Db2: java.lang.IllegalStateException: Needed to have 6 in buffer but only had 0. In JDBC we would normally block
36+
@Rule
37+
public final DatabaseSelectionRule skip = skipTestsFor( DB2 );
3038
@Override
3139
protected Collection<Class<?>> annotatedEntities() {
3240
return List.of( Shop.class, Version.class, Product.class );
3341
}
34-
3542
@Test
3643
public void testOrphan(TestContext context) {
3744
Shop shop = new Shop( "shop" );

hibernate-reactive-core/src/test/java/org/hibernate/reactive/SecondaryTableTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
import java.util.List;
1111
import java.util.Objects;
1212

13+
import org.hibernate.reactive.testing.DatabaseSelectionRule;
14+
15+
import org.junit.Rule;
1316
import org.junit.Test;
1417

1518
import io.vertx.ext.unit.TestContext;
@@ -23,9 +26,16 @@
2326
import jakarta.persistence.Temporal;
2427
import jakarta.persistence.TemporalType;
2528

29+
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.DB2;
30+
import static org.hibernate.reactive.testing.DatabaseSelectionRule.skipTestsFor;
31+
2632

2733
public class SecondaryTableTest extends BaseReactiveTest {
2834

35+
//Db2: java.lang.IllegalStateException: Needed to have 6 in buffer but only had 0. In JDBC we would normally block
36+
@Rule
37+
public final DatabaseSelectionRule skip = skipTestsFor( DB2 );
38+
2939
@Override
3040
protected Collection<Class<?>> annotatedEntities() {
3141
return List.of( Book.class, Author.class );

0 commit comments

Comments
 (0)