Skip to content

Commit

Permalink
test: properly close vertx instances
Browse files Browse the repository at this point in the history
  • Loading branch information
machi1990 committed Nov 20, 2019
1 parent a454a08 commit 91d56d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void startWiser() {
@AfterAll
static void stopWiser() {
wiser.stop();
vertx.close();
vertx.close().toCompletableFuture().join();
}

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static void start() {

@AfterAll
static void stop() {
vertx.close();
vertx.close().toCompletableFuture().join();
}

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static org.hamcrest.CoreMatchers.is;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import org.eclipse.microprofile.config.ConfigProvider;
Expand Down Expand Up @@ -32,8 +33,10 @@ public static void initializeVertx() {
}

@AfterAll
public static void closeVertx() {
vertx.close();
public static void closeVertx() throws InterruptedException {
CountDownLatch latch = new CountDownLatch(1);
vertx.close((h) -> latch.countDown());
latch.await();
}

@Test
Expand Down

0 comments on commit 91d56d1

Please sign in to comment.