Commit 5de5390e authored by Andy Wilkinson's avatar Andy Wilkinson

Merge branch '2.4.x' into 2.5.x

Closes gh-26889
parents 3858c629 c89430e1
......@@ -22,11 +22,13 @@ import java.net.SocketTimeoutException;
import java.nio.ByteBuffer;
import java.nio.channels.ByteChannel;
import java.nio.channels.Channels;
import java.time.Duration;
import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
......@@ -236,13 +238,14 @@ class HttpTunnelServerTests {
this.server.setLongPollTimeout(100);
MockHttpConnection h1 = new MockHttpConnection();
this.server.handle(h1);
Awaitility.await().atMost(Duration.ofSeconds(30)).until(h1.getServletResponse()::getStatus,
(status) -> status == 204);
MockHttpConnection h2 = new MockHttpConnection();
this.server.handle(h2);
Thread.sleep(400);
Awaitility.await().atMost(Duration.ofSeconds(30)).until(h2.getServletResponse()::getStatus,
(status) -> status == 204);
this.serverChannel.disconnect();
this.server.getServerThread().join();
assertThat(h1.getServletResponse().getStatus()).isEqualTo(204);
assertThat(h2.getServletResponse().getStatus()).isEqualTo(204);
}
@Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment