File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
vertx-pg-client/src/test/java/io/vertx/pgclient Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -69,20 +69,24 @@ public void start() {
6969 public void testCloseAutomatically (TestContext ctx ) {
7070 int maxSize = 8 ;
7171 int instances = maxSize * 4 ;
72- Async latch = ctx .async (instances );
72+ Async latch = ctx .async (1 + instances );
7373 AtomicReference <String > deployment = new AtomicReference <>();
7474 Async async = ctx .async ();
7575 vertx .deployVerticle (() -> new AbstractVerticle () {
76- PgPool pool ;
77- @ Override
78- public void start () {
79- pool = PgPool .pool (vertx , options , new PoolOptions ().setMaxSize (maxSize ).setShared (true ));
80- pool
81- .query ("SELECT 1" )
82- .execute ()
83- .onComplete (ctx .asyncAssertSuccess (res -> latch .countDown ()));
84- }
85- }, new DeploymentOptions ().setInstances (instances )).onComplete (ctx .asyncAssertSuccess (deployment ::set ));
76+ PgPool pool ;
77+ @ Override
78+ public void start () {
79+ pool = PgPool .pool (vertx , options , new PoolOptions ().setMaxSize (maxSize ).setShared (true ));
80+ pool
81+ .query ("SELECT 1" )
82+ .execute ()
83+ .onComplete (ctx .asyncAssertSuccess (res -> latch .countDown ()));
84+ }
85+ }, new DeploymentOptions ().setInstances (instances ))
86+ .onComplete (ctx .asyncAssertSuccess (id -> {
87+ deployment .set (id );
88+ latch .countDown ();
89+ }));
8690 latch .awaitSuccess (20_000 );
8791 vertx .undeploy (deployment .get ())
8892 .compose (v -> PgConnection .connect (vertx , options ))
You can’t perform that action at this time.
0 commit comments