@@ -384,7 +384,7 @@ public void testPipeliningDistribution(TestContext ctx) {
384
384
public void testPoolIdleTimeout (TestContext ctx ) {
385
385
ProxyServer proxy = ProxyServer .create (vertx , options .getPort (), options .getHost ());
386
386
AtomicReference <ProxyServer .Connection > proxyConn = new AtomicReference <>();
387
- int pooleCleanerPeriod = 100 ;
387
+ int poolCleanerPeriod = 100 ;
388
388
int idleTimeout = 3000 ;
389
389
Async latch = ctx .async ();
390
390
proxy .proxyHandler (conn -> {
@@ -393,8 +393,8 @@ public void testPoolIdleTimeout(TestContext ctx) {
393
393
conn .clientCloseHandler (v -> {
394
394
long lifetime = System .currentTimeMillis () - now ;
395
395
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 ;
398
398
ctx .assertTrue (lifetime >= lowerBound , "Was expecting connection to be closed in more than " + lowerBound + ": " + lifetime );
399
399
ctx .assertTrue (lifetime <= upperBound , "Was expecting connection to be closed in less than " + upperBound + ": " + lifetime );
400
400
latch .complete ();
@@ -408,7 +408,7 @@ public void testPoolIdleTimeout(TestContext ctx) {
408
408
listenLatch .awaitSuccess (20_000 );
409
409
410
410
poolOptions
411
- .setPoolCleanerPeriod (pooleCleanerPeriod )
411
+ .setPoolCleanerPeriod (poolCleanerPeriod )
412
412
.setMaxLifetime (0 )
413
413
.setIdleTimeout (idleTimeout )
414
414
.setIdleTimeoutUnit (TimeUnit .MILLISECONDS );
@@ -427,7 +427,7 @@ public void testPoolIdleTimeout(TestContext ctx) {
427
427
public void testPoolMaxLifetime (TestContext ctx ) {
428
428
ProxyServer proxy = ProxyServer .create (vertx , options .getPort (), options .getHost ());
429
429
AtomicReference <ProxyServer .Connection > proxyConn = new AtomicReference <>();
430
- int pooleCleanerPeriod = 100 ;
430
+ int poolCleanerPeriod = 100 ;
431
431
int maxLifetime = 3000 ;
432
432
Async latch = ctx .async ();
433
433
proxy .proxyHandler (conn -> {
@@ -436,8 +436,8 @@ public void testPoolMaxLifetime(TestContext ctx) {
436
436
conn .clientCloseHandler (v -> {
437
437
long lifetime = System .currentTimeMillis () - now ;
438
438
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 ;
441
441
ctx .assertTrue (lifetime >= lowerBound , "Was expecting connection to be closed in more than " + lowerBound + ": " + lifetime );
442
442
ctx .assertTrue (lifetime <= upperBound , "Was expecting connection to be closed in less than " + upperBound + ": " + lifetime );
443
443
latch .complete ();
@@ -451,7 +451,7 @@ public void testPoolMaxLifetime(TestContext ctx) {
451
451
listenLatch .awaitSuccess (20_000 );
452
452
453
453
poolOptions
454
- .setPoolCleanerPeriod (pooleCleanerPeriod )
454
+ .setPoolCleanerPeriod (poolCleanerPeriod )
455
455
.setIdleTimeout (0 )
456
456
.setMaxLifetime (maxLifetime )
457
457
.setMaxLifetimeUnit (TimeUnit .MILLISECONDS );
@@ -507,9 +507,9 @@ public void testPoolConnectTimeout(TestContext ctx) {
507
507
public void testNoConnectionLeaks (TestContext ctx ) {
508
508
Async killConnections = ctx .async ();
509
509
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 ());
511
511
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 );
513
513
Tuple params = Tuple .of (options .getDatabase ());
514
514
preparedQuery .execute (params ).compose (cf -> conn .close ()).onComplete (ctx .asyncAssertSuccess (v -> killConnections .complete ()));
515
515
}));
0 commit comments