Skip to content

Commit 9207070

Browse files
committed
Fix unstable QuicServerTest.testRebind
Closes #5941
1 parent 01e00da commit 9207070

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

vertx-core/src/test/java/io/vertx/tests/net/quic/QuicServerTest.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import io.netty.util.NetUtil;
2020
import io.vertx.core.*;
2121
import io.vertx.core.buffer.Buffer;
22+
import io.vertx.core.internal.ContextInternal;
2223
import io.vertx.core.internal.quic.QuicConnectionInternal;
2324
import io.vertx.core.internal.quic.QuicStreamInternal;
2425
import io.vertx.core.net.*;
@@ -891,12 +892,21 @@ private void testWriteWhenClosed(boolean write) throws Exception {
891892

892893
@Test
893894
public void testRebind() {
894-
Deployable deployable = ctx -> {
895-
QuicServer server = QuicServer.create(vertx, SSL_OPTIONS);
896-
server.handler(connection -> {
895+
Deployable deployable = new Deployable() {
896+
private QuicServer server;
897+
@Override
898+
public Future<?> deploy(Context ctx) {
899+
server = QuicServer.create(vertx, SSL_OPTIONS);
900+
server.handler(connection -> {
897901

898-
});
899-
return server.bind(SocketAddress.inetSocketAddress(9999, "localhost"));
902+
});
903+
return server.bind(SocketAddress.inetSocketAddress(9999, "localhost"));
904+
}
905+
906+
@Override
907+
public Future<?> undeploy(Context context) {
908+
return server.close();
909+
}
900910
};
901911
int num = 4;
902912
for (int i = 0;i < num;i++) {

0 commit comments

Comments
 (0)