Skip to content

Commit 50e36a1

Browse files
committed
Fix expected type of pg_terminate_backend result in testNoConnectionLeaks
1 parent 8729b72 commit 50e36a1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

vertx-pg-client/src/test/java/io/vertx/pgclient/PgPoolTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public void testPipeliningDistribution(TestContext ctx) {
338338
public void testPoolIdleTimeout(TestContext ctx) {
339339
ProxyServer proxy = ProxyServer.create(vertx, options.getPort(), options.getHost());
340340
AtomicReference<ProxyServer.Connection> proxyConn = new AtomicReference<>();
341-
int pooleCleanerPeriod = 100;
341+
int poolCleanerPeriod = 100;
342342
int idleTimeout = 3000;
343343
Async latch = ctx.async();
344344
proxy.proxyHandler(conn -> {
@@ -347,8 +347,8 @@ public void testPoolIdleTimeout(TestContext ctx) {
347347
conn.clientCloseHandler(v -> {
348348
long lifetime = System.currentTimeMillis() - now;
349349
int delta = 500;
350-
int lowerBound = idleTimeout - pooleCleanerPeriod - delta;
351-
int upperBound = idleTimeout + pooleCleanerPeriod + delta;
350+
int lowerBound = idleTimeout - poolCleanerPeriod - delta;
351+
int upperBound = idleTimeout + poolCleanerPeriod + delta;
352352
ctx.assertTrue(lifetime >= lowerBound, "Was expecting connection to be closed in more than " + lowerBound + ": " + lifetime);
353353
ctx.assertTrue(lifetime <= upperBound, "Was expecting connection to be closed in less than " + upperBound + ": "+ lifetime);
354354
latch.complete();
@@ -362,7 +362,7 @@ public void testPoolIdleTimeout(TestContext ctx) {
362362
listenLatch.awaitSuccess(20_000);
363363

364364
poolOptions
365-
.setPoolCleanerPeriod(pooleCleanerPeriod)
365+
.setPoolCleanerPeriod(poolCleanerPeriod)
366366
.setMaxLifetime(0)
367367
.setIdleTimeout(idleTimeout)
368368
.setIdleTimeoutUnit(TimeUnit.MILLISECONDS);
@@ -381,7 +381,7 @@ public void testPoolIdleTimeout(TestContext ctx) {
381381
public void testPoolMaxLifetime(TestContext ctx) {
382382
ProxyServer proxy = ProxyServer.create(vertx, options.getPort(), options.getHost());
383383
AtomicReference<ProxyServer.Connection> proxyConn = new AtomicReference<>();
384-
int pooleCleanerPeriod = 100;
384+
int poolCleanerPeriod = 100;
385385
int maxLifetime = 3000;
386386
Async latch = ctx.async();
387387
proxy.proxyHandler(conn -> {
@@ -390,8 +390,8 @@ public void testPoolMaxLifetime(TestContext ctx) {
390390
conn.clientCloseHandler(v -> {
391391
long lifetime = System.currentTimeMillis() - now;
392392
int delta = 500;
393-
int lowerBound = maxLifetime - pooleCleanerPeriod - delta;
394-
int upperBound = maxLifetime + pooleCleanerPeriod + delta;
393+
int lowerBound = maxLifetime - poolCleanerPeriod - delta;
394+
int upperBound = maxLifetime + poolCleanerPeriod + delta;
395395
ctx.assertTrue(lifetime >= lowerBound, "Was expecting connection to be closed in more than " + lowerBound + ": " + lifetime);
396396
ctx.assertTrue(lifetime <= upperBound, "Was expecting connection to be closed in less than " + upperBound + ": "+ lifetime);
397397
latch.complete();
@@ -405,7 +405,7 @@ public void testPoolMaxLifetime(TestContext ctx) {
405405
listenLatch.awaitSuccess(20_000);
406406

407407
poolOptions
408-
.setPoolCleanerPeriod(pooleCleanerPeriod)
408+
.setPoolCleanerPeriod(poolCleanerPeriod)
409409
.setIdleTimeout(0)
410410
.setMaxLifetime(maxLifetime)
411411
.setMaxLifetimeUnit(TimeUnit.MILLISECONDS);
@@ -460,9 +460,9 @@ public void testPoolConnectTimeout(TestContext ctx) {
460460
public void testNoConnectionLeaks(TestContext ctx) {
461461
Async killConnections = ctx.async();
462462
PgConnection.connect(vertx, options, ctx.asyncAssertSuccess(conn -> {
463-
Collector<Row, ?, List<Integer>> collector = mapping(row -> row.getInteger(0), toList());
463+
Collector<Row, ?, List<Boolean>> collector = mapping(row -> row.getBoolean(0), toList());
464464
String sql = "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND datname = $1";
465-
PreparedQuery<SqlResult<List<Integer>>> preparedQuery = conn.preparedQuery(sql).collecting(collector);
465+
PreparedQuery<SqlResult<List<Boolean>>> preparedQuery = conn.preparedQuery(sql).collecting(collector);
466466
Tuple params = Tuple.of(options.getDatabase());
467467
preparedQuery.execute(params).compose(cf -> conn.close()).onComplete(ctx.asyncAssertSuccess(v -> killConnections.complete()));
468468
}));

0 commit comments

Comments
 (0)