Skip to content

Commit d839f24

Browse files
committed
Fix expected type of pg_terminate_backend result in testNoConnectionLeaks
1 parent ef4b573 commit d839f24

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ public void testPipeliningDistribution(TestContext ctx) {
384384
public void testPoolIdleTimeout(TestContext ctx) {
385385
ProxyServer proxy = ProxyServer.create(vertx, options.getPort(), options.getHost());
386386
AtomicReference<ProxyServer.Connection> proxyConn = new AtomicReference<>();
387-
int pooleCleanerPeriod = 100;
387+
int poolCleanerPeriod = 100;
388388
int idleTimeout = 3000;
389389
Async latch = ctx.async();
390390
proxy.proxyHandler(conn -> {
@@ -393,8 +393,8 @@ public void testPoolIdleTimeout(TestContext ctx) {
393393
conn.clientCloseHandler(v -> {
394394
long lifetime = System.currentTimeMillis() - now;
395395
int delta = 500;
396-
int lowerBound = idleTimeout - pooleCleanerPeriod - delta;
397-
int upperBound = idleTimeout + pooleCleanerPeriod + delta;
396+
int lowerBound = idleTimeout - poolCleanerPeriod - delta;
397+
int upperBound = idleTimeout + poolCleanerPeriod + delta;
398398
ctx.assertTrue(lifetime >= lowerBound, "Was expecting connection to be closed in more than " + lowerBound + ": " + lifetime);
399399
ctx.assertTrue(lifetime <= upperBound, "Was expecting connection to be closed in less than " + upperBound + ": "+ lifetime);
400400
latch.complete();
@@ -408,7 +408,7 @@ public void testPoolIdleTimeout(TestContext ctx) {
408408
listenLatch.awaitSuccess(20_000);
409409

410410
poolOptions
411-
.setPoolCleanerPeriod(pooleCleanerPeriod)
411+
.setPoolCleanerPeriod(poolCleanerPeriod)
412412
.setMaxLifetime(0)
413413
.setIdleTimeout(idleTimeout)
414414
.setIdleTimeoutUnit(TimeUnit.MILLISECONDS);
@@ -427,7 +427,7 @@ public void testPoolIdleTimeout(TestContext ctx) {
427427
public void testPoolMaxLifetime(TestContext ctx) {
428428
ProxyServer proxy = ProxyServer.create(vertx, options.getPort(), options.getHost());
429429
AtomicReference<ProxyServer.Connection> proxyConn = new AtomicReference<>();
430-
int pooleCleanerPeriod = 100;
430+
int poolCleanerPeriod = 100;
431431
int maxLifetime = 3000;
432432
Async latch = ctx.async();
433433
proxy.proxyHandler(conn -> {
@@ -436,8 +436,8 @@ public void testPoolMaxLifetime(TestContext ctx) {
436436
conn.clientCloseHandler(v -> {
437437
long lifetime = System.currentTimeMillis() - now;
438438
int delta = 500;
439-
int lowerBound = maxLifetime - pooleCleanerPeriod - delta;
440-
int upperBound = maxLifetime + pooleCleanerPeriod + delta;
439+
int lowerBound = maxLifetime - poolCleanerPeriod - delta;
440+
int upperBound = maxLifetime + poolCleanerPeriod + delta;
441441
ctx.assertTrue(lifetime >= lowerBound, "Was expecting connection to be closed in more than " + lowerBound + ": " + lifetime);
442442
ctx.assertTrue(lifetime <= upperBound, "Was expecting connection to be closed in less than " + upperBound + ": "+ lifetime);
443443
latch.complete();
@@ -451,7 +451,7 @@ public void testPoolMaxLifetime(TestContext ctx) {
451451
listenLatch.awaitSuccess(20_000);
452452

453453
poolOptions
454-
.setPoolCleanerPeriod(pooleCleanerPeriod)
454+
.setPoolCleanerPeriod(poolCleanerPeriod)
455455
.setIdleTimeout(0)
456456
.setMaxLifetime(maxLifetime)
457457
.setMaxLifetimeUnit(TimeUnit.MILLISECONDS);
@@ -507,9 +507,9 @@ public void testPoolConnectTimeout(TestContext ctx) {
507507
public void testNoConnectionLeaks(TestContext ctx) {
508508
Async killConnections = ctx.async();
509509
PgConnection.connect(vertx, options).onComplete(ctx.asyncAssertSuccess(conn -> {
510-
Collector<Row, ?, List<Integer>> collector = mapping(row -> row.getInteger(0), toList());
510+
Collector<Row, ?, List<Boolean>> collector = mapping(row -> row.getBoolean(0), toList());
511511
String sql = "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND datname = $1";
512-
PreparedQuery<SqlResult<List<Integer>>> preparedQuery = conn.preparedQuery(sql).collecting(collector);
512+
PreparedQuery<SqlResult<List<Boolean>>> preparedQuery = conn.preparedQuery(sql).collecting(collector);
513513
Tuple params = Tuple.of(options.getDatabase());
514514
preparedQuery.execute(params).compose(cf -> conn.close()).onComplete(ctx.asyncAssertSuccess(v -> killConnections.complete()));
515515
}));

0 commit comments

Comments
 (0)