Skip to content

Commit db3d74e

Browse files
committed
Fix test race issue
1 parent 2a15ed6 commit db3d74e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void start() {
6868
public void testCloseAutomatically(TestContext ctx) {
6969
int maxSize = 8;
7070
int instances = maxSize * 4;
71-
Async latch = ctx.async(instances);
71+
Async latch = ctx.async(1 + instances);
7272
AtomicReference<String> deployment = new AtomicReference<>();
7373
Async async = ctx.async();
7474
vertx.deployVerticle(() -> new AbstractVerticle() {
@@ -80,7 +80,10 @@ public void start() {
8080
.query("SELECT 1")
8181
.execute(ctx.asyncAssertSuccess(res -> latch.countDown()));
8282
}
83-
}, new DeploymentOptions().setInstances(instances), ctx.asyncAssertSuccess(deployment::set));
83+
}, new DeploymentOptions().setInstances(instances), ctx.asyncAssertSuccess(id -> {
84+
deployment.set(id);
85+
latch.countDown();
86+
}));
8487
latch.awaitSuccess(20_000);
8588
vertx.undeploy(deployment.get())
8689
.compose(v -> PgConnection.connect(vertx, options))

0 commit comments

Comments
 (0)