Skip to content

Commit

Permalink
Re enable no leak oracle tests (#1484)
Browse files Browse the repository at this point in the history
* Revert "Disable OracleConnectionTest#testConnectNoLeak tests (#1482)"

This reverts commit c30df2f.

* Reduce number of connections made in testConnectNoLeak tests

We only need a few of them to verify whether there is a leak.
And we avoid putting to much pressure on the Oracle test DB.

Signed-off-by: Thomas Segismont <tsegismont@gmail.com>

---------

Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
  • Loading branch information
tsegismont authored Jan 9, 2025
1 parent 25d9056 commit 94b4ae1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import io.vertx.sqlclient.spi.DatabaseMetadata;
import io.vertx.sqlclient.tck.ConnectionTestBase;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(VertxUnitRunner.class)
Expand All @@ -43,24 +41,4 @@ protected void validateDatabaseMetaData(TestContext ctx, DatabaseMetadata md) {
ctx.assertTrue(md.fullVersion().contains("Oracle"));
ctx.assertTrue(md.productName().contains("Oracle"));
}

@Test
@Ignore
@Override
public void testConnectNoLeak(TestContext ctx) throws Exception {
// Disabled for Oracle because we frequently get ORA-12516 Cannot connect to database
// https://docs.oracle.com/en/error-help/db/ora-12516/?r=23ai
// Probable cause is that the service handler gets in a blocked state and is not accepting new connections
super.testConnectNoLeak(ctx);
}

@Test
@Ignore
@Override
public void testConnectNoLeakInVerticle(TestContext ctx) throws Exception {
// Disabled for Oracle because we frequently get ORA-12516 Cannot connect to database
// https://docs.oracle.com/en/error-help/db/ora-12516/?r=23ai
// Probable cause is that the service handler gets in a blocked state and is not accepting new connections
super.testConnectNoLeakInVerticle(ctx);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public void testConnect(TestContext ctx) {
public void testConnectNoLeak(TestContext ctx) throws Exception {
Set<SqlConnectionBase<?>> connections = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>()));
Set<ConnectionFactory> factories = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>()));
Async async = ctx.async(100);
for (int i = 0; i < 100; i++) {
Async async = ctx.async(10);
for (int i = 0; i < 10; i++) {
connect(ctx.asyncAssertSuccess(conn -> {
SqlConnectionBase<?> base = (SqlConnectionBase<?>) conn;
connections.add(base);
Expand All @@ -80,11 +80,11 @@ public void testConnectNoLeak(TestContext ctx) throws Exception {
public void testConnectNoLeakInVerticle(TestContext ctx) throws Exception {
Set<SqlConnectionBase<?>> connections = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>()));
Set<ConnectionFactory> factories = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>()));
Async async = ctx.async(100);
Async async = ctx.async(10);
vertx.deployVerticle(new AbstractVerticle() {
@Override
public void start() throws Exception {
for (int i = 0; i < 100; i++) {
for (int i = 0; i < 10; i++) {
connect(ctx.asyncAssertSuccess(conn -> {
SqlConnectionBase<?> base = (SqlConnectionBase<?>) conn;
connections.add(base);
Expand Down

0 comments on commit 94b4ae1

Please sign in to comment.