diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/GrpcPingPongResourceTest.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/GrpcPingPongResourceTest.java index 055dc161..be6fc2d9 100644 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/GrpcPingPongResourceTest.java +++ b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/GrpcPingPongResourceTest.java @@ -6,6 +6,7 @@ import org.junit.jupiter.api.Disabled; +import io.quarkus.grpc.GrpcService; import io.quarkus.qe.pong.GrpcPongService; import io.quarkus.test.junit.QuarkusTest; @@ -14,6 +15,7 @@ public class GrpcPingPongResourceTest extends AbstractPingPongResourceTest { @Inject + @GrpcService GrpcPongService pongService; @Override diff --git a/303-quarkus-vertx-sql/src/test/java/io/quarkus/qe/vertx/sql/dbpool/Db2PoolTest.java b/303-quarkus-vertx-sql/src/test/java/io/quarkus/qe/vertx/sql/dbpool/Db2PoolTest.java deleted file mode 100644 index 9c494075..00000000 --- a/303-quarkus-vertx-sql/src/test/java/io/quarkus/qe/vertx/sql/dbpool/Db2PoolTest.java +++ /dev/null @@ -1,86 +0,0 @@ -package io.quarkus.qe.vertx.sql.dbpool; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.fail; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.inject.Inject; -import javax.inject.Named; - -import org.eclipse.microprofile.config.inject.ConfigProperty; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -import io.quarkus.qe.vertx.sql.test.resources.Db2TestProfile; -import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.TestProfile; -import io.smallrye.mutiny.Multi; -import io.vertx.core.Handler; -import io.vertx.core.logging.Logger; -import io.vertx.core.logging.LoggerFactory; -import io.vertx.mutiny.core.Vertx; -import io.vertx.mutiny.db2client.DB2Pool; -import io.vertx.mutiny.sqlclient.Row; -import io.vertx.mutiny.sqlclient.RowSet; - -@Disabled("Caused by https://github.com/quarkusio/quarkus/issues/14608") -@QuarkusTest -@TestProfile(Db2TestProfile.class) -public class Db2PoolTest extends AbstractCommons { - - private static final Logger LOGGER = LoggerFactory.getLogger(Db2PoolTest.class); - - @ConfigProperty(name = "quarkus.datasource.db2.reactive.idle-timeout") - int idle; - - @Inject - @Named("db2") - DB2Pool db2; - - @Test - @DisplayName("Idle issue: Fail to read any response from the server, the underlying connection might get lost unexpectedly.") - public void checkBorderConditionBetweenIdleAndGetConnection() { - try { - long idleMs = TimeUnit.SECONDS.toMillis(idle); - latch = new CountDownLatch(1); // ignore, this test will run until Timeout or get an error occurs. - AtomicInteger at = new AtomicInteger(0); - Handler handler = l -> { - LOGGER.info("###################################################: "); - Multi.createFrom().range(1, 3) - .concatMap(n -> { - LOGGER.info("Connection #" + at.incrementAndGet()); - return db2.preparedQuery("SELECT CURRENT TIMESTAMP result FROM sysibm.sysdummy1") - .execute().onFailure().invoke(error -> { - LOGGER.info("Error: " + at.get()); - LOGGER.error("Error on query: '" + error.getMessage() + "'"); - latch.countDown(); - fail(error.getMessage()); - }).map(RowSet::iterator).onItem().transform(iterator -> { - LocalDateTime result = LocalDateTime.now(); - if (iterator.hasNext()) { - Row row = iterator.next(); - LOGGER.info("Result : " + at.get() + " : " + row.getLocalDateTime(0)); - result = row.getLocalDateTime(0); - } - return result; - }).toMulti(); - }).collect().in(ArrayList::new, List::add).subscribe().with(re -> { - LOGGER.info("Subscribe success: -> " + re.get(0)); - }, Throwable::printStackTrace); - }; - Vertx.vertx().setPeriodic(idleMs + 3, l -> handler.handle(l)); - await(5, TimeUnit.MINUTES); - assertEquals(1, latch.getCount(), "An unexpected error was thrown."); - } catch (IllegalStateException ex) { - } finally { - assertEquals(1, latch.getCount(), "An unexpected error was thrown."); - } - } -} diff --git a/303-quarkus-vertx-sql/src/test/java/io/quarkus/qe/vertx/sql/dbpool/MysqlPoolTest.java b/303-quarkus-vertx-sql/src/test/java/io/quarkus/qe/vertx/sql/dbpool/MysqlPoolTest.java deleted file mode 100644 index 66211837..00000000 --- a/303-quarkus-vertx-sql/src/test/java/io/quarkus/qe/vertx/sql/dbpool/MysqlPoolTest.java +++ /dev/null @@ -1,86 +0,0 @@ -package io.quarkus.qe.vertx.sql.dbpool; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.fail; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.inject.Inject; -import javax.inject.Named; - -import org.eclipse.microprofile.config.inject.ConfigProperty; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -import io.quarkus.qe.vertx.sql.test.resources.MysqlTestProfile; -import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.TestProfile; -import io.smallrye.mutiny.Multi; -import io.vertx.core.Handler; -import io.vertx.core.logging.Logger; -import io.vertx.core.logging.LoggerFactory; -import io.vertx.mutiny.core.Vertx; -import io.vertx.mutiny.mysqlclient.MySQLPool; -import io.vertx.mutiny.sqlclient.Row; -import io.vertx.mutiny.sqlclient.RowSet; - -@Disabled("Caused by https://github.com/quarkusio/quarkus/issues/14608") -@QuarkusTest -@TestProfile(MysqlTestProfile.class) -public class MysqlPoolTest extends AbstractCommons { - - private static final Logger LOGGER = LoggerFactory.getLogger(MysqlPoolTest.class); - - @ConfigProperty(name = "quarkus.datasource.mysql.reactive.idle-timeout") - int idle; - - @Inject - @Named("mysql") - MySQLPool mysql; - - @Test - @DisplayName("Idle issue: Fail to read any response from the server, the underlying connection might get lost unexpectedly.") - public void checkBorderConditionBetweenIdleAndGetConnection() { - try { - long idleMs = TimeUnit.SECONDS.toMillis(idle); - latch = new CountDownLatch(1); // ignore, this test will run until Timeout or get an error occurs. - AtomicInteger at = new AtomicInteger(0); - Handler handler = l -> { - LOGGER.info("###################################################: "); - Multi.createFrom().range(1, 3) - .concatMap(n -> { - LOGGER.info("Connection #" + at.incrementAndGet()); - return mysql.preparedQuery("SELECT CURRENT_TIMESTAMP") - .execute().onFailure().invoke(error -> { - LOGGER.info("Error: " + at.get()); - LOGGER.error("Error on query: '" + error.getMessage() + "'"); - latch.countDown(); - fail(error.getMessage()); - }).map(RowSet::iterator).onItem().transform(iterator -> { - LocalDateTime result = LocalDateTime.now(); - if (iterator.hasNext()) { - Row row = iterator.next(); - LOGGER.info("Result : " + at.get() + " : " + row.getLocalDateTime(0)); - result = row.getLocalDateTime(0); - } - return result; - }).toMulti(); - }).collect().in(ArrayList::new, List::add).subscribe().with(re -> { - LOGGER.info("Subscribe success: -> " + re.get(0)); - }, Throwable::printStackTrace); - }; - Vertx.vertx().setPeriodic(idleMs + 3, l -> handler.handle(l)); - await(5, TimeUnit.MINUTES); - } catch (IllegalStateException ex) { - } finally { - assertEquals(1, latch.getCount(), "An unexpected error was thrown."); - } - } - -} diff --git a/303-quarkus-vertx-sql/src/test/java/io/quarkus/qe/vertx/sql/dbpool/PostgresPoolTest.java b/303-quarkus-vertx-sql/src/test/java/io/quarkus/qe/vertx/sql/dbpool/PostgresPoolTest.java index a57759ab..8aeb305c 100644 --- a/303-quarkus-vertx-sql/src/test/java/io/quarkus/qe/vertx/sql/dbpool/PostgresPoolTest.java +++ b/303-quarkus-vertx-sql/src/test/java/io/quarkus/qe/vertx/sql/dbpool/PostgresPoolTest.java @@ -31,9 +31,9 @@ import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; import io.vertx.core.Handler; +import io.vertx.core.impl.logging.Logger; +import io.vertx.core.impl.logging.LoggerFactory; import io.vertx.core.json.JsonArray; -import io.vertx.core.logging.Logger; -import io.vertx.core.logging.LoggerFactory; import io.vertx.ext.web.client.WebClientOptions; import io.vertx.mutiny.core.Vertx; import io.vertx.mutiny.ext.web.client.HttpResponse; @@ -74,7 +74,6 @@ public static void beforeAll() { @Test @DisplayName("DB connections are re-used") @Order(1) - @Disabled("Need to double check. flaky test") public void checkDbPoolTurnover() throws InterruptedException { final int events = 25000; CountDownLatch done = new CountDownLatch(events); @@ -139,7 +138,7 @@ public void checkIdleExpirationTime() throws InterruptedException { @Test @DisplayName("Idle issue: Fail to read any response from the server, the underlying connection might get lost unexpectedly.") @Order(3) - @Disabled("QUARKUS-719") + @Disabled("Takes too much time and is fixed by Vertx 4.1") public void checkBorderConditionBetweenIdleAndGetConnection() { try { long idleMs = TimeUnit.SECONDS.toMillis(idle); @@ -177,10 +176,9 @@ public void checkBorderConditionBetweenIdleAndGetConnection() { } } - // TODO: double check if we should care about `IDLE` state connections -> https://github.com/quarkusio/quarkus/issues/16444 private Uni activeConnections() { return postgresql.query( - "SELECT count(*) as active_con FROM pg_stat_activity where application_name like '%vertx%' and state = 'active'") + "SELECT count(*) as active_con FROM pg_stat_activity where application_name like '%vertx%'") .execute() .onItem().transform(RowSet::iterator).onItem() .transform(iterator -> iterator.hasNext() ? iterator.next().getLong("active_con") : null);