Stabilize socketChannelClosedTriggersTunnelClose

Closes gh-27483
pull/27537/head
Andy Wilkinson 3 years ago
parent 14db8aec95
commit cff1827e27

@ -72,7 +72,8 @@ class TunnelClientTests {
TunnelClient client = new TunnelClient(0, this.tunnelConnection); TunnelClient client = new TunnelClient(0, this.tunnelConnection);
int port = client.start(); int port = client.start();
SocketChannel channel = SocketChannel.open(new InetSocketAddress(port)); SocketChannel channel = SocketChannel.open(new InetSocketAddress(port));
Thread.sleep(200); Awaitility.await().atMost(Duration.ofSeconds(30)).until(this.tunnelConnection::getOpenedTimes,
(open) -> open == 1);
channel.close(); channel.close();
client.getServerThread().stopAcceptingConnections(); client.getServerThread().stopAcceptingConnections();
client.getServerThread().join(2000); client.getServerThread().join(2000);

Loading…
Cancel
Save